[ python-Bugs-860515 ] fileinput does not use universal input

SourceForge.net noreply at sourceforge.net
Tue May 31 23:42:05 CEST 2005


Bugs item #860515, was opened at 2003-12-15 20:11
Message generated for change (Comment added) made by birkenfeld
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: Open
Resolution: None
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: Reinhold Birkenfeld (birkenfeld)
Date: 2005-05-31 23: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