[issue11426] CSV examples can't close their files

2011-03-12 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

This should be now fixed in 3.x, but not on 2.7.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-12 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 52e1ad467edd by Eli Bendersky in branch '2.7':
Issue #11426: use 'with' statements on open files in CSV examples
http://hg.python.org/cpython/rev/52e1ad467edd

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-12 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
resolution:  - accepted
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-11 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Patch looks good to me.
The quotes are somewhat inconsistent (sometimes '' and sometimes ), if you 
want you can fix them while you are at it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-11 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset f2a73d65422a by Eli Bendersky in branch 'default':
Issue #11426: use 'with' statements on open files in CSV examples
http://hg.python.org/cpython/rev/f2a73d65422a

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-11 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

SilentGhost: yep, thanks for the reminder :)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-11 Thread Roundup Robot

Roundup Robot devnull@devnull added the comment:

New changeset 4cb0a8f5c952 by Eli Bendersky in branch 'default':
Issue #11426: use 'with' statements on open files in CSV examples
http://hg.python.org/cpython/rev/4cb0a8f5c952

New changeset d54e9c4fcd43 by Eli Bendersky in branch '3.1':
Issue #11426: use 'with' statements on open files in CSV examples
http://hg.python.org/cpython/rev/d54e9c4fcd43

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-10 Thread Eli Bendersky

Eli Bendersky eli...@gmail.com added the comment:

The attached patch tries to be true to the convention in other documentation 
pages, by using with in complete code samples (examples), but not using it in 
prompt () samples, where usage of with unnecessarily complicates 
interaction.

--
keywords: +patch
nosy: +ezio.melotti, georg.brandl, ncoghlan
stage:  - patch review
Added file: http://bugs.python.org/file21078/issue11426.1.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-07 Thread Eli Bendersky

Changes by Eli Bendersky eli...@gmail.com:


--
nosy: +eli.bendersky

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11426] CSV examples can't close their files

2011-03-06 Thread Graham Wideman

New submission from Graham Wideman initcont...@grahamwideman.com:

On the csv doc page  (.../library/csv.html) most of the examples show creation 
of an anonymous file object within the csv.reader or csv.writer function, for 
example...

spamWriter = csv.writer(open('eggs.csv', 'w'), delimiter=' ',

This anonymity prevents later closing the file, which seems especially 
problematic for a writer.  It also confuses users as to whether there's some 
sort of close function on a csv.reader or csv.writer object which should be 
called, or perhaps some other magic behind the scenes.

I'm pretty sure that it's the doc that is incorrect here.  

This issue was raised pernthetically here 
http://bugs.python.org/issue7198#msg124678 by sjmachin, though mysteriously 
overlooked in his later suggested patch 
http://bugs.python.org/issue7198#msg126593

I suggest changing all examples to include the complete cycle of opening an 
explicit file, and later closing it.

--
assignee: docs@python
components: Documentation
messages: 130228
nosy: docs@python, gwideman
priority: normal
severity: normal
status: open
title: CSV examples can't close their files
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11426
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com