[issue3860] GzipFile and BZ2File should support context manager protocol

2011-02-12 Thread K Richard Pixley
K Richard Pixley r...@noir.com added the comment: Documentation needs to be updated to state that these are now context managers. This is important since they aren't in python-2.x. I'm not sure whether this should be added to the new in python blurbs. -- nosy: +teamnoir

[issue3860] GzipFile and BZ2File should support context manager protocol

2009-01-10 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Committed in trunk and py3k. Thanks! -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3860 ___

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-26 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I love with ... as f: and I want it for gzip/bz2 files! Comment about the patch: (1) the IOError message is different for the two modules: I/O operation on closed GzipFile object vs I/O operation on closed file Specify the

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-26 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: (1) the IOError message is different for the two modules: I/O operation on closed GzipFile object vs I/O operation on closed file I've reused the same error message as used in other parts of each module. (2) For bz2module, Why don't

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a patch for the trunk. I'm waiting for the opinion other developers before deciding to commit or no. -- keywords: +patch nosy: +pitrou stage: - patch review Added file: http://bugs.python.org/file12398/withgzip.patch

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-18 Thread Benjamin Peterson
Benjamin Peterson musiccomposit...@gmail.com added the comment: Here's the StringIO discussion: #1286 -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3860 ___

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-12-18 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thanks. The outcome of the StringIO discussion isn't clearly negative, although Guido does not see a big benefit in it. If some people are opposed to this, please stand up :) Otherwise I'll commit the patch to trunk.

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-09-13 Thread Hagen Fürstenau
New submission from Hagen Fürstenau [EMAIL PROTECTED]: When you've become used to writing with open(xzy, w) as f: it's strange when it doesn't work for gzip.open or bz2.BZ2File. Or is there a reason for them not being context managers? -- components: Library (Lib) messages: 73194

[issue3860] GzipFile and BZ2File should support context manager protocol

2008-09-13 Thread Benjamin Peterson
Changes by Benjamin Peterson [EMAIL PROTECTED]: -- priority: - normal versions: +Python 2.7, Python 3.1 -Python 2.6, Python 3.0 ___ Python tracker [EMAIL PROTECTED] http://bugs.python.org/issue3860 ___