Skip to content

Commit 9dfefbe

Browse files
authored
bpo-43651: Fix EncodingWarning in pydoc. (GH-25644)
1 parent 284c52d commit 9dfefbe

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Lib/pydoc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,9 +1594,10 @@ def plain(text):
15941594
def pipepager(text, cmd):
15951595
"""Page through text by feeding it to another program."""
15961596
import subprocess
1597-
proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE)
1597+
proc = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE,
1598+
errors='backslashreplace')
15981599
try:
1599-
with io.TextIOWrapper(proc.stdin, errors='backslashreplace') as pipe:
1600+
with proc.stdin as pipe:
16001601
try:
16011602
pipe.write(text)
16021603
except KeyboardInterrupt:

0 commit comments

Comments
 (0)