diff options
author | Inada Naoki <songofacandy@gmail.com> | 2022-05-19 02:42:43 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 02:42:43 (GMT) |
commit | 96f65835f8f66d058b444e0b4e436af45e2902f7 (patch) | |
tree | 84906fe995aca491347f2ce5e4d63b4c751fa20d /Doc | |
parent | f2d994da104eed38f9e110e7d8f37fa6d845b207 (diff) | |
download | cpython-96f65835f8f66d058b444e0b4e436af45e2902f7.zip cpython-96f65835f8f66d058b444e0b4e436af45e2902f7.tar.gz cpython-96f65835f8f66d058b444e0b4e436af45e2902f7.tar.bz2 |
gh-87901: Remove the encoding argument from os.popen (GH-92836)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/os.rst | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 3c189bb..dc0f2e4 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -3916,13 +3916,13 @@ written in Python, such as a mail server's external command delivery program. .. availability:: Unix. -.. function:: popen(cmd, mode='r', buffering=-1, encoding=None) +.. function:: popen(cmd, mode='r', buffering=-1) Open a pipe to or from command *cmd*. The return value is an open file object connected to the pipe, which can be read or written depending on whether *mode* is ``'r'`` (default) or ``'w'``. - The *buffering* and *encoding* arguments have the same meaning as + The *buffering* argument have the same meaning as the corresponding argument to the built-in :func:`open` function. The returned file object reads or writes text strings rather than bytes. @@ -3945,8 +3945,13 @@ written in Python, such as a mail server's external command delivery program. documentation for more powerful ways to manage and communicate with subprocesses. - .. versionchanged:: 3.11 - Added the *encoding* parameter. + .. note:: + The :ref:`Python UTF-8 Mode <utf8-mode>` affects encodings used + for *cmd* and pipe contents. + + :func:`popen` is a simple wrapper around :class:`subprocess.Popen`. + Use :class:`subprocess.Popen` or :func:`subprocess.run` to + control options like encodings. .. function:: posix_spawn(path, argv, env, *, file_actions=None, \ |