diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2022-05-19 03:12:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-19 03:12:47 (GMT) |
commit | aa55985aa85ebad5409ed5485fd4957d5ca28f94 (patch) | |
tree | 750b0fe6460e6944d235b06b06f9720a945035d8 /Lib/os.py | |
parent | 849963598fa0454ef1bc9c93f5654d63f59e830d (diff) | |
download | cpython-aa55985aa85ebad5409ed5485fd4957d5ca28f94.zip cpython-aa55985aa85ebad5409ed5485fd4957d5ca28f94.tar.gz cpython-aa55985aa85ebad5409ed5485fd4957d5ca28f94.tar.bz2 |
gh-87901: Remove the encoding argument from os.popen (GH-92836)
(cherry picked from commit 96f65835f8f66d058b444e0b4e436af45e2902f7)
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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, |