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 amaury.forgeotdarc
Recipients Valery.Khamenya, amaury.forgeotdarc, meador.inge
Date 2011-10-08.21:58:42
SpamBayes Score 1.8333158e-07
Marked as misclassified No
Message-id <1318111123.36.0.0967907405063.issue13133@psf.upfronthosting.co.za>
In-reply-to
Content
Yes, in 2.7 many parts of the stdlib relies on reference counting to close files.  But 3.2 introduced a ResourceWarning which is emitted (in debug mode) each time a __del__ closes a valuable resource like a file or a socket.  This was done exactly for this reason - help other implementations with a different garbage collector.

Now Lib/zipfile.py is probably much more gc-friendly: see how it uses a new member "close_fileobj", and the "with" statement in ZipFile.read().

PyPy will benefit of this when it migrates to 3.2; meanwhile, you could apply the same changes in pypy's own copy of zipfile.py.
History
Date User Action Args
2011-10-08 21:58:43amaury.forgeotdarcsetrecipients: + amaury.forgeotdarc, meador.inge, Valery.Khamenya
2011-10-08 21:58:43amaury.forgeotdarcsetmessageid: <1318111123.36.0.0967907405063.issue13133@psf.upfronthosting.co.za>
2011-10-08 21:58:42amaury.forgeotdarclinkissue13133 messages
2011-10-08 21:58:42amaury.forgeotdarccreate