summaryrefslogtreecommitdiffstats
path: root/Lib/os.py
diff options
context:
space:
mode:
authorInada Naoki <songofacandy@gmail.com>2021-04-29 02:35:36 (GMT)
committerGitHub <noreply@github.com>2021-04-29 02:35:36 (GMT)
commita69256527f93d2aa32e76658deab829e324d97b6 (patch)
tree64ac0ac29ea6df144a25a1aa6c8396b1413c373b /Lib/os.py
parentfa51c0c448aca9fe5d4e8bc02e71de528931778b (diff)
downloadcpython-a69256527f93d2aa32e76658deab829e324d97b6.zip
cpython-a69256527f93d2aa32e76658deab829e324d97b6.tar.gz
cpython-a69256527f93d2aa32e76658deab829e324d97b6.tar.bz2
bpo-43651: Fix EncodingWarning in `os.fdopen()` and test_os (GH-25654)
Diffstat (limited to 'Lib/os.py')
-rw-r--r--Lib/os.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/os.py b/Lib/os.py
index ea09e8c..d26cfc9 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -983,16 +983,16 @@ if sys.platform != 'vxworks':
import subprocess, io
if mode == "r":
proc = subprocess.Popen(cmd,
- shell=True,
+ shell=True, text=True,
stdout=subprocess.PIPE,
bufsize=buffering)
- return _wrap_close(io.TextIOWrapper(proc.stdout), proc)
+ return _wrap_close(proc.stdout, proc)
else:
proc = subprocess.Popen(cmd,
- shell=True,
+ shell=True, text=True,
stdin=subprocess.PIPE,
bufsize=buffering)
- return _wrap_close(io.TextIOWrapper(proc.stdin), proc)
+ return _wrap_close(proc.stdin, proc)
# Helper for popen() -- a proxy for a file whose close waits for the process
class _wrap_close: