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 rhettinger
Recipients DaRoee, pitrou, rhettinger, vinay.sajip
Date 2021-04-26.02:09:04
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1619402945.48.0.0757232271933.issue43939@roundup.psfhosted.org>
In-reply-to
Content
A few thoughts:

* We normally say "all bets are off" when it comes to manipulating Python internals with ctypes.  This issue is just one of many ways to wreak havoc.

* The programming pattern of killing running threads at arbitrary points in their execution is inherently fragile.  I don't think other modules are obliged to try to support it. 

* The pattern of "acquire(); try: something(); finally release();" is common.  Logging is only of many modules in the ecosystem that use this pattern.

* ISTM we can't assume that the lock is a context manager because createLock() is a public method and users can do anything with it.

* That said, we could add our own __enter__ and __exit__ methods to the Handler class.

* Lastly, I have a vague memory that at one point there was a rejected proposal to switch logging to use the with-statement throughout.  We should research that to see if the reasoning is still applicable or not.
History
Date User Action Args
2021-04-26 02:09:05rhettingersetrecipients: + rhettinger, vinay.sajip, pitrou, DaRoee
2021-04-26 02:09:05rhettingersetmessageid: <1619402945.48.0.0757232271933.issue43939@roundup.psfhosted.org>
2021-04-26 02:09:04rhettingerlinkissue43939 messages
2021-04-26 02:09:04rhettingercreate