[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-10 Thread Eryk Sun
Eryk Sun added the comment: > my subrocess code doesn't seem to hang on Linux where the > thread example code does? Reader threads for stdout and stderr are only used in Windows, since there's no equivalent to select/poll for synchronous pipes in Windows. Without using threads, I/O with

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +rhettinger ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Kevin M
Kevin M added the comment: eryksun, wow, that's speedy analysis, but there might be more to it. I went and tested a bunch of test cases. my subrocess code doesn't seem to hang on Linux where the thread example code does? Linux - Python 3.6.8 - your threading example DOESN'T hang Linux -

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Eryk Sun
Change by Eryk Sun : -- nosy: +pitrou ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43784] starting a thread in __del__ hangs at interpreter shutdown

2021-04-09 Thread Eryk Sun
Eryk Sun added the comment: It's not a subprocess bug, per se. It's due to creating the stdout/stderr worker threads from the __del__ finalizer while the interpreter is shutting down. Minimal reproducer, confirmed in both Linux and Windows: import threading class C: def