Skip to content

Commit d381d77

Browse files
committed
pythongh-87901: os.popen: Make encoding keyword only
1 parent 0924b95 commit d381d77

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Doc/library/os.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3916,7 +3916,7 @@ written in Python, such as a mail server's external command delivery program.
39163916
.. availability:: Unix.
39173917

39183918

3919-
.. function:: popen(cmd, mode='r', buffering=-1, encoding=None)
3919+
.. function:: popen(cmd, mode='r', buffering=-1, *, encoding=None)
39203920

39213921
Open a pipe to or from command *cmd*.
39223922
The return value is an open file object

Lib/os.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ def spawnlpe(mode, file, *args):
974974
# command in a shell can't be supported.
975975
if sys.platform != 'vxworks':
976976
# Supply os.popen()
977-
def popen(cmd, mode="r", buffering=-1, encoding=None):
977+
def popen(cmd, mode="r", buffering=-1, *, encoding=None):
978978
if not isinstance(cmd, str):
979979
raise TypeError("invalid cmd type (%s, expected string)" % type(cmd))
980980
if mode not in ("r", "w"):

0 commit comments

Comments
 (0)