bpo-43651: Fix EncodingWarning in os.fdopen() and test_os (GH-25654)

This commit is contained in:
Inada Naoki 2021-04-29 11:35:36 +09:00 committed by GitHub
parent fa51c0c448
commit a69256527f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 13 deletions

View file

@ -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: