This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: csv readers and writers should be context managers
Type: enhancement Stage: resolved
Components: Library (Lib) Versions:
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: djc, r.david.murray
Priority: normal Keywords:

Created on 2011-02-04 09:39 by djc, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg127876 - (view) Author: Dirkjan Ochtman (djc) * (Python committer) Date: 2011-02-04 09:39
The context managers should simply forward to the underlying file object.
msg127887 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2011-02-04 13:44
There is no underlying file object.  I presume you mean the reader/writer object?  Which have no close method, so there is no point in making them a context manager.  There is zero benefit and positive cost (an additional nesting level).  Just use with to open the file you then wrap in a reader/writer instance.
Date User Action Args
2022-04-11 14:57:12adminsetgithub: 55324
2011-02-04 13:44:23r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg127887

resolution: rejected
stage: resolved
2011-02-04 09:40:02djcsettype: enhancement
versions: - Python 2.6
2011-02-04 09:39:23djccreate