This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author josh.r
Recipients boyombo, josh.r
Date 2016-04-12.01:52:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460425957.32.0.250623370895.issue26737@psf.upfronthosting.co.za>
In-reply-to
Content
This already behaves usefully in 3.5 where reading fieldnames from a DictReader wrapping a file opened in binary mode gets you:

_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)

And 2.7 is highly unlikely to make fit and finish fixes at this stage in the game.

That said, not sure what you'd expect in 2.7; standard open in binary mode is correct there, and you'd get str either way. Is the problem that it's not a CSV file in the first place? Because Python 2's csv isn't encoding aware; as long as it doesn't have embedded NULs, anything could be legitimate data (csv doesn't have the context to say that it should be latin-1, EBCDIC, or whatever).
History
Date User Action Args
2016-04-12 01:52:37josh.rsetrecipients: + josh.r, boyombo
2016-04-12 01:52:37josh.rsetmessageid: <1460425957.32.0.250623370895.issue26737@psf.upfronthosting.co.za>
2016-04-12 01:52:37josh.rlinkissue26737 messages
2016-04-12 01:52:36josh.rcreate