[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming
Cal Leeming added the comment: @david Gotcha - I had a feeling that would be the case. Thank you for the quick replies anyway guys! Hopefully this will help others in the future :) -- ___ Python tracker _

[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread R. David Murray
R. David Murray added the comment: We don't generally do that kind of type checking. -- nosy: +r.david.murray resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python tracker ___

[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Tim Golden
Tim Golden added the comment: It already produces a TypeError with a specific message if the input is not iterable. You seem to be using a homegrown dialect; with the conventional list (csv.reader("the quick brown fox")) you very quickly see that you're iterating over a string. -- nosy:

[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming
Cal Leeming added the comment: Okay, just found the reason for this.. It's because I was putting a .read() on the file descriptor.. I really think that the CSVReader should raise an assertion in the event that it is passed an object which has no iterator, or if it is given a string, as this

[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming
Cal Leeming added the comment: This bug also seems to be showing in 2.7.3 -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming
Cal Leeming added the comment: Sorry, accidently pasted the wrong code snippet previously. The correct code snippet is: datx = open("data.txt", "rb").read() rows = csv.reader( datx ) for row in rows: print x -- ___ Python tracker

[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming
New submission from Cal Leeming : Getting some extremely strange behavior when attempting to parse a fairly standard CSV in Python 2.6.6. I've tried a whole different mixture of dialects, quoting options, line terminators etc, and none seem to get a happy ending. Spent about 2 hours banging m