New submission from Graham Wideman: The docs appear to be incorrect for CSV at: http://docs.python.org/3.3/library/csv.html.
Per issue http://bugs.python.org/issue7198 , there's a long history of contention between os.open and csv.writer, in which, on Windows, the default result is an unwanted additional '\r'. That was 'fixed' by using the newline='' argument to open(). This is reflected in the docs at the above link: with open('eggs.csv', 'w', newline='') as csvfile: spamwriter = csv.writer(csvfile, delimiter=...) However, in python 3.3.2 use of the newline argument returns: "TypeError: 'newline' is an invalid keyword argument for this function." In brief testing, it appears that a correct result can be obtain by calling open as follows: with open(somepath, 'wb') as writerfile: writer = csv.writer(writerfile, delimiter=...) Note: binary mode, not text as previously needed and currently documented. ---------- assignee: docs@python components: Documentation messages: 198752 nosy: docs@python, gwideman priority: normal severity: normal status: open title: CSV, builtin open(), newline arg. Docs broken again. type: behavior versions: Python 3.3, Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19136> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com