[ python-Bugs-860515 ] fileinput does not use universal input
SourceForge.net
noreply at sourceforge.net
Mon Feb 20 21:06:32 CET 2006
Bugs item #860515, was opened at 2003-12-15 19:11
Message generated for change (Comment added) made by gbrandl
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=860515&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.3
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Russell Owen (reowen)
Assigned to: Nobody/Anonymous (nobody)
Summary: fileinput does not use universal input
Initial Comment:
In Python 2.3.0 the fileinput module does not appear to use universal line ending mode for reading files. I found this using MacPython 2.3 (via the binary installer) but looking at the module it appears to be vanilla code. I confess I didn't see where the files were opened, so I cannot suggest a fix.
Sample code:
import fileinput
for line in fileinput.input():
print line[0:20]
try this with text files that have some other platform's line endings. For me, it works on MacOS X for files with unix line endings, but fails if the file(s) have Mac line endings.
----------------------------------------------------------------------
>Comment By: Georg Brandl (gbrandl)
Date: 2006-02-20 20:06
Message:
Logged In: YES
user_id=849994
Patch #1212287 was now committed, so closing this.
----------------------------------------------------------------------
Comment By: Georg Brandl (birkenfeld)
Date: 2005-05-31 21:42
Message:
Logged In: YES
user_id=1188172
See patch #1212287.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=860515&group_id=5470
More information about the Python-bugs-list
mailing list