R. David Murray <rdmur...@bitdance.com> added the comment:

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).

----------
nosy: +r.david.murray, vinay.sajip

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue10462>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to