Author jesstess
Recipients docs@python, georg.brandl, jesstess, r.david.murray, sfinnie, terry.reedy
Date 2014-04-20.01:42:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I ran some experiments to see what the state of the world is. I generated a test.csv by exporting a CSV file from Numbers on OSX. This generated a file with Windows-style \r\n-terminated lines. The attached tries to open this CSV file in binary and universal newlines modes. Here's what happens on various platforms

Python 3:
* Linux: both binary and universal work
* OSX: binary errors out, universal works
* Windows: binary errors out, universal works

In both cases, the error was:

$ python3
Traceback (most recent call last):
  File "", line 5, in <module>
    for row in spamreader:
_csv.Error: iterator should return strings, not bytes (did you open the file in text mode?)

Python 2:
* Linux: both binary and universal work
* OSX: both binary and universal
* Windows: wasn't readily able to test

If I manually create a CSV file using TextEdit in plaintext mode on OSX, that produces a file with Mac-style \r-terminated lines. has the same results on this file on OSX (errors out in binary mode in Python 3).
Date User Action Args
2014-04-20 01:42:02jesstesssetrecipients: + jesstess, georg.brandl, terry.reedy, r.david.murray, sfinnie, docs@python
2014-04-20 01:42:02jesstesssetmessageid: <>
2014-04-20 01:42:02jesstesslinkissue8387 messages
2014-04-20 01:42:01jesstesscreate