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 r.david.murray
Recipients Shufla, r.david.murray, vinay.sajip
Date 2010-11-19.20:02:17
SpamBayes Score 1.2755799e-08
Marked as misclassified No
Message-id <1290196940.49.0.406268451445.issue10462@psf.upfronthosting.co.za>
In-reply-to
Content
I doubt that close is ever called when removehandler is called.  That doesn't strike me as sensible semantics.  I suspect that what is happening is that in 2.6 calling removehandler removed all references to the handler, and python's garbage collection called the close method during cleanup.  In 2.7 something is probably still holding a reference; I know Vinay made a number of changes in how handlers are handled in 2.7/3.2.

I think Vinay will want to take a look since (assuming I am correct) the holding of the reference may be a bug, so I'm adding him to nosy.

However, you shouldn't depend on close getting called after the removehandler, since not all Python implementations do garbage collection/cleanup in the same way.  You should always explicitly call close when you are done with a resource.

Finally, I don't understand the point of your third example (but I haven't run it).
History
Date User Action Args
2010-11-19 20:02:20r.david.murraysetrecipients: + r.david.murray, vinay.sajip, Shufla
2010-11-19 20:02:20r.david.murraysetmessageid: <1290196940.49.0.406268451445.issue10462@psf.upfronthosting.co.za>
2010-11-19 20:02:17r.david.murraylinkissue10462 messages
2010-11-19 20:02:17r.david.murraycreate