[issue8387] use universal newline mode in csv module examples

Jessica McKellar report at bugs.python.org
Sun Apr 20 04:07:22 CEST 2014


Jessica McKellar added the comment:

All of the examples from https://docs.python.org/3/library/csv.html run without issue on OSX, though.

In summary, the Python 2 examples error out on OSX and switching them to use 'U' instead of 'b' would fix this. I don't think any action needs to be taken for Python 3.

My one remaining question is about binary files on Windows. The Python 2 csv docs say "If csvfile is a file object, it must be opened with the ‘b’ flag on platforms where that makes a difference." I don't readily have a Windows machine to play with this -- do "binary" CSV files exist, or can we eliminate the 'b' language entirely and just talk about 'U'?

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8387>
_______________________________________


More information about the Python-bugs-list mailing list