Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 550e4e5

Browse files
committed
SF bug 666444: 'help' makes linefeed only under Win32.
Reverting one of those irritating "security fixes". fdopen() opens files in binary mode. That makes pydoc skip the \r\n on Windows that's need to make the output readable in the shell. Screw it.
1 parent 658375b commit 550e4e5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/pydoc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,8 @@ def pipepager(text, cmd):
12291229
def tempfilepager(text, cmd):
12301230
"""Page through text by invoking a program on a temporary file."""
12311231
import tempfile
1232-
(fd, filename) = tempfile.mkstemp()
1233-
file = os.fdopen(fd, 'w')
1232+
filename = tempfile.mktemp()
1233+
file = open(filename, 'w')
12341234
file.write(text)
12351235
file.close()
12361236
try:

0 commit comments

Comments
 (0)