[ python-Bugs-1381476 ] csv.reader endless loop
SourceForge.net
noreply at sourceforge.net
Thu Dec 15 12:04:27 CET 2005
Bugs item #1381476, was opened at 2005-12-15 11:04
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1381476&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.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Christian Harms (wwwingman)
Assigned to: Nobody/Anonymous (nobody)
Summary: csv.reader endless loop
Initial Comment:
Hi,
the csv.reader produce a endless loop, ifan parsing
Error is in the last line of the CSV-File. If you put
an "\r" in the last line, cvs.Error is raised and
StopIteration will lost.
import csv, StringIO
fp = StringIO.StringIO("line1\nline2\rerror")
reader = csv.reader(fp)
while 1:
try:
print reader.next()
except csv.Error:
print "Error"
except StopIteration:
break
Die Problem is in python 2.3 AND python 2.4. Other
version are not checked.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1381476&group_id=5470
More information about the Python-bugs-list
mailing list