@@ -3916,13 +3916,13 @@ written in Python, such as a mail server's external command delivery program.
3916
3916
.. availability :: Unix.
3917
3917
3918
3918
3919
- .. function :: popen(cmd, mode='r', buffering=-1, encoding=None )
3919
+ .. function :: popen(cmd, mode='r', buffering=-1)
3920
3920
3921
3921
Open a pipe to or from command *cmd *.
3922
3922
The return value is an open file object
3923
3923
connected to the pipe, which can be read or written depending on whether *mode *
3924
3924
is ``'r' `` (default) or ``'w' ``.
3925
- The *buffering * and * encoding * arguments have the same meaning as
3925
+ The *buffering * argument have the same meaning as
3926
3926
the corresponding argument to the built-in :func: `open ` function. The
3927
3927
returned file object reads or writes text strings rather than bytes.
3928
3928
@@ -3945,8 +3945,14 @@ written in Python, such as a mail server's external command delivery program.
3945
3945
documentation for more powerful ways to manage and communicate with
3946
3946
subprocesses.
3947
3947
3948
- .. versionchanged :: 3.11
3949
- Added the *encoding * parameter.
3948
+ .. note ::
3949
+ On Unix, the *cmd * argument is encoded with
3950
+ :term: `file system encoding <filesystem encoding and error handler> `.
3951
+ The returned file object connected to the pipe uses
3952
+ :func: `locale.getpreferredencoding(False) <locale.getpreferredencoding>`_.
3953
+ The :ref:`Python UTF-8 Mode <utf8-mode> ` affects both encodings.
3954
+
3955
+ Use :class: `subprocess.Popen ` to control encoding and many other options.
3950
3956
3951
3957
3952
3958
.. function :: posix_spawn(path, argv, env, *, file_actions=None, \
0 commit comments