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.
Created on 2008年05月24日 23:26 by mmagin, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| gzip.py.patch | mmagin, 2008年05月24日 23:26 | patch to allow multiple calls to close. | ||
| Messages (2) | |||
|---|---|---|---|
| msg67313 - (view) | Author: Michael Magin (mmagin) | Date: 2008年05月24日 23:25 | |
Built-in file objects allow repeated calls to .close(), even the documentation states, "Calling close() more than once is allowed." (http://docs.python.org/lib/bltin-file-objects.html) GzipFile does not obey this aspect of the file interface: >>> import gzip >>> f = gzip.GzipFile('testfile1.gz', 'ab') >>> f.close() >>> f.close() Traceback (most recent call last): File "<stdin>", line 1, in ? File "/Library/Frameworks/Python.framework/Versions/2.4//lib/python2.4/gzip.py", line 315, in close self.fileobj.write(self.compress.flush()) AttributeError: 'NoneType' object has no attribute 'write' The gzip documentation does not document this (mis-)behavior. (Trivial) patch against 2.4.3 gzip.py attached. |
|||
| msg67329 - (view) | Author: Georg Brandl (georg.brandl) * (Python committer) | Date: 2008年05月25日 08:07 | |
Thanks, fixed in r63614. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:34 | admin | set | github: 47208 |
| 2008年05月25日 08:07:50 | georg.brandl | set | status: open -> closed resolution: fixed messages: + msg67329 nosy: + georg.brandl |
| 2008年05月24日 23:26:11 | mmagin | create | |