summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2022-05-19 02:42:43 (GMT)
committerGitHub <noreply@github.com>2022-05-19 02:42:43 (GMT)
commit96f65835f8f66d058b444e0b4e436af45e2902f7 (patch)
tree84906fe995aca491347f2ce5e4d63b4c751fa20d /Lib/os.py
parentf2d994da104eed38f9e110e7d8f37fa6d845b207 (diff)
downloadcpython-96f65835f8f66d058b444e0b4e436af45e2902f7.zip
cpython-96f65835f8f66d058b444e0b4e436af45e2902f7.tar.gz
cpython-96f65835f8f66d058b444e0b4e436af45e2902f7.tar.bz2
gh-87901: Remove the encoding argument from os.popen (GH-92836)
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/Lib/os.py b/Lib/os.py
index 67662ca..648188e 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -974,15 +974,14 @@ otherwise return -SIG, where SIG is the signal that killed it. """
# command in a shell can't be supported.
if sys.platform != 'vxworks':
# Supply os.popen()
- def popen(cmd, mode="r", buffering=-1, encoding=None):
+ def popen(cmd, mode="r", buffering=-1):
if not isinstance(cmd, str):
raise TypeError("invalid cmd type (%s, expected string)" % type(cmd))
if mode not in ("r", "w"):
raise ValueError("invalid mode %r" % mode)
if buffering == 0 or buffering is None:
raise ValueError("popen() does not support unbuffered streams")
- import subprocess, io
- encoding = io.text_encoding(encoding)
+ import subprocess
if mode == "r":
proc = subprocess.Popen(cmd,
shell=True, text=True,