[Python-bugs-list] [ python-Bugs-666444 ] 'help' makes linefeed only under Win32
SourceForge.net
noreply@sourceforge.net
Thu, 06 Feb 2003 17:49:55 -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: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory Smith (gregsmith)
>Assigned to: Tim Peters (tim_one)
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: Neal Norwitz (nnorwitz)
Date: 2003-02-06 20:49
Message:
Logged In: YES
user_id=33168
Looking at the code, I don't see any problems. I'm guessing
this may be a windows issue. Universal newlines only seems
to affect reading, so shouldn't be an issue. Hopefully Tim
has time, interest, and a clue, since I don't. Tim, do you
know if there is a difference between fopen() and fdopen()
on windows?
----------------------------------------------------------------------
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