Message391874
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. |
|
Date |
User |
Action |
Args |
2021-04-26 02:09:05 | rhettinger | set | recipients:
+ rhettinger, vinay.sajip, pitrou, DaRoee |
2021-04-26 02:09:05 | rhettinger | set | messageid: <1619402945.48.0.0757232271933.issue43939@roundup.psfhosted.org> |
2021-04-26 02:09:04 | rhettinger | link | issue43939 messages |
2021-04-26 02:09:04 | rhettinger | create | |
|