mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-87901: Add encoding to os.popen (GH-92374)
This commit is contained in:
parent
926854e858
commit
2b563f1ad3
3 changed files with 9 additions and 3 deletions
|
@ -3916,12 +3916,13 @@ written in Python, such as a mail server's external command delivery program.
|
|||
.. availability:: Unix.
|
||||
|
||||
|
||||
.. function:: popen(cmd, mode='r', buffering=-1)
|
||||
.. function:: popen(cmd, mode='r', buffering=-1, encoding=None)
|
||||
|
||||
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* argument has the same meaning as
|
||||
is ``'r'`` (default) or ``'w'``.
|
||||
The *buffering* and *encoding* arguments 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.
|
||||
|
||||
|
@ -3944,6 +3945,9 @@ 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.
|
||||
|
||||
|
||||
.. function:: posix_spawn(path, argv, env, *, file_actions=None, \
|
||||
setpgroup=None, resetids=False, setsid=False, setsigmask=(), \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue