diff options
author | Inada Naoki <songofacandy@gmail.com> | 2021-04-27 03:46:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-27 03:46:20 (GMT) |
commit | 9dfefbe3e2dc548ad306870b56cc0cb475aa20a2 (patch) | |
tree | 8c9dfcf4d1051c6400210eaf680c10e537fd026e /Lib/pydoc.py | |
parent | 284c52da092438522949d6f96d8c1f9ff37f9f00 (diff) | |
download | cpython-9dfefbe3e2dc548ad306870b56cc0cb475aa20a2.zip cpython-9dfefbe3e2dc548ad306870b56cc0cb475aa20a2.tar.gz cpython-9dfefbe3e2dc548ad306870b56cc0cb475aa20a2.tar.bz2 |
bpo-43651: Fix EncodingWarning in `pydoc`. (GH-25644)
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-x | Lib/pydoc.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py index 753ea97..8eecd66 100755 --- a/Lib/pydoc.py +++ b/Lib/pydoc.py @@ -1594,9 +1594,10 @@ def plain(text): def pipepager(text, cmd): """Page through text by feeding it to another program.""" import subprocess - proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE) + proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, + errors='backslashreplace') try: - with io.TextIOWrapper(proc.stdin, errors='backslashreplace') as pipe: + with proc.stdin as pipe: try: pipe.write(text) except KeyboardInterrupt: |