[New-bugs-announce] [issue6723] csv.writer: example does not work

Nicolas Goutte report at bugs.python.org
Tue Aug 18 14:38:34 CEST 2009

New submission from Nicolas Goutte <nicolas.goutte at extragroup.de>:

In the documentation for csv.writer, the example
spamWriter = csv.writer(open('eggs.csv', 'w'), delimiter=' ',
quotechar='|', quoting=QUOTE_MINIMAL)
does not work, as Python complains about "SyntaxError: invalid syntax",
as QUOTE_MINIMAL is not a global identifier.

By replacing QUOTE_MINIMAL by csv.QUOTE_MINIMAL there is no syntax error

I have discovered the issue with python 2.6.2. All online documentation
version (2.6, 2.7, 3.1, 3.2) seem to have the same documentation (e.g.
http://docs.python.org/library/csv.html )

assignee: georg.brandl
components: Documentation
messages: 91682
nosy: georg.brandl, nicolasg
severity: normal
status: open
title: csv.writer: example does not work
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list