[Python-bugs-list] [ python-Bugs-666444 ] 'help' makes linefeed only under Win32
SourceForge.net
noreply@sourceforge.net
Wed, 15 Jan 2003 21:05:02 -0800
Bugs item #666444, was opened at 2003-01-11 20:04
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=666444&group_id=5470
Category: Extension Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory Smith (gregsmith)
Assigned to: Nobody/Anonymous (nobody)
Summary: 'help' makes linefeed only under Win32
Initial Comment:
The 'help' command, under a win32 console app, separates
lines with \n instead of \r\n as it has in the past,
making its
output a little hard to follow. Possibly an unintended
side effect
of the 'universal newline' addition?
Python 2.3a1 (#38, Dec 31 2002, 17:53:59) [MSC v.1200
32 bit (Intel)] on win32
(windows 98)
----------------------------------------------------------------------
>Comment By: Gregory Smith (gregsmith)
Date: 2003-01-16 00:05
Message:
Logged In: YES
user_id=292741
Tracked this down to a change in pydoc.py:
---------------- 2.2.2 -------------------------
def tempfilepager(text, cmd):
import tempfile
filename = tempfile.mktemp()
file = open(filename, 'w')
file.write(text)
file.close()
------------------2.3 -------------------------
def tempfilepager(text, cmd):
import tempfile
(fd, filename) = tempfile.mkstemp()
file = os.fdopen(fd, 'w')
file.write(text)
file.close()
------------------------------------------------
It seems the use of fdopen means that \n's don't
get changed to \r\n when the file is written, even though
'w' is used. Whether this should be fixed by modding this
code, or whether this is a fdopen bug, I don't know.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=666444&group_id=5470