Eryk Sun <eryk...@gmail.com> 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 __del__(self):
            t = threading.Thread(target=print, args=('spam',), daemon=True)
            t.start()

    c = C()
    #del c # uncomment to prevent hanging

----------
components:  -Windows
nosy: +eryksun
title: [Windows] interpreter hangs indefinitely on subprocess.communicate 
during __del__ at script exit -> starting a thread in __del__ hangs at 
interpreter shutdown
type:  -> behavior
versions: +Python 3.10, Python 3.8

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

Reply via email to