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.

Author mmagin
Recipients mmagin
Date 2008-05-24.23:25:41
SpamBayes Score 0.0023094567
Marked as misclassified No
Message-id <>
Built-in file objects allow repeated calls to .close(), even the
documentation states, "Calling close() more than once is allowed."

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 ?
line 315, in close
AttributeError: 'NoneType' object has no attribute 'write'

The gzip documentation does not document this (mis-)behavior.

(Trivial) patch against 2.4.3 attached.
Date User Action Args
2008-05-24 23:26:22mmaginsetspambayes_score: 0.00230946 -> 0.0023094567
recipients: + mmagin
2008-05-24 23:26:13mmaginsetspambayes_score: 0.00230946 -> 0.00230946
messageid: <>
2008-05-24 23:26:10mmaginlinkissue2959 messages
2008-05-24 23:26:07mmagincreate