summaryrefslogtreecommitdiff
path: root/Lib/pydoc.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/pydoc.py')
-rwxr-xr-xLib/pydoc.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/pydoc.py b/Lib/pydoc.py
index 753ea97ba0..8eecd66a2c 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: