classification
Title: csv.writer: example does not work
Type: Stage:
Components: Documentation Versions: Python 2.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: skip.montanaro Nosy List: georg.brandl, nicolasg, skip.montanaro
Priority: normal Keywords:

Created on 2009-08-18 12:38 by nicolasg, last changed 2009-08-18 14:47 by skip.montanaro. This issue is now closed.

Messages (4)
msg91682 - (view) Author: Nicolas Goutte (nicolasg) Date: 2009-08-18 12:38
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
anymore.

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 )
msg91691 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-08-18 14:41
Thanks for the report.  Fixed for 2.6, 2.7, 3.0, 3.2. Can't seem to check
out a 3.1 branch (tried release31-maint but was rebuffed by svn).
msg91693 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-08-18 14:43
figured out my checkout problem.  will have 3.1 fixed shortly.
msg91694 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2009-08-18 14:47
3.1 corrected as well.
History
Date User Action Args
2009-08-18 14:47:24skip.montanarosetstatus: open -> closed
resolution: fixed
messages: + msg91694
2009-08-18 14:43:57skip.montanarosetassignee: georg.brandl -> skip.montanaro
messages: + msg91693
2009-08-18 14:41:10skip.montanarosetnosy: + skip.montanaro
messages: + msg91691
2009-08-18 12:38:33nicolasgcreate