]> granicus.if.org Git - python/commitdiff
SF bug 666444: 'help' makes linefeed only under Win32.
authorTim Peters <tim.peters@gmail.com>
Fri, 7 Feb 2003 01:53:46 +0000 (01:53 +0000)
committerTim Peters <tim.peters@gmail.com>
Fri, 7 Feb 2003 01:53:46 +0000 (01:53 +0000)
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.

Lib/pydoc.py

index 9179721c71dde4b9f56789f50aab8643abe52bd4..9e55a8968787489459f8de25c321e386a1072d43 100755 (executable)
@@ -1229,8 +1229,8 @@ def pipepager(text, cmd):
 def tempfilepager(text, cmd):
     """Page through text by invoking a program on a temporary file."""
     import tempfile
-    (fd, filename) = tempfile.mkstemp()
-    file = os.fdopen(fd, 'w')
+    filename = tempfile.mktemp()
+    file = open(filename, 'w')
     file.write(text)
     file.close()
     try: