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 methane
Recipients methane, minstrelofc, xtreak
Date 2021-10-16.02:26:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1634351175.62.0.998862148811.issue45475@roundup.psfhosted.org>
In-reply-to
Content
>>> ll = [l for l in gzip.GzipFile(filename='data/UTF-8-test_for_gzip.txt.gz')]

This is bad code pattern because you don't close the file explicitly.
Actually, the error caused by the optimization thet iter(GzipFile) returns underlaying faster iterator that don't have reference to the GzipFile. So GzipFile.__del__ close the file.

Although this is caused by bad code pattern, I must admit this is a regression.
We need to call slow Python function for each lines instead of using fast C iterator...
History
Date User Action Args
2021-10-16 02:26:15methanesetrecipients: + methane, xtreak, minstrelofc
2021-10-16 02:26:15methanesetmessageid: <1634351175.62.0.998862148811.issue45475@roundup.psfhosted.org>
2021-10-16 02:26:15methanelinkissue45475 messages
2021-10-16 02:26:15methanecreate