Josh Rosenberg added the comment: 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). ---------- nosy: +josh.r _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26737> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com