-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can not communicate with subprocess during interpreter shutdown on windows #115219
Comments
(cc @ericsnowcurrently) One possibility is to transform the Windows code here into a purely native thread, rather than a Python thread, but that is likely to break people who are passing file objects to What might be better, and why I pinged Eric, is to find a finalization ordering where we can run |
See gh-116677. |
This subprocess on Windows atexit or from a non-daemon thread use case is a good one. I'm going to mark this a duplicate of our more general issue #113964 on the topic where we've got a PR and likely a second one in the works to address this. |
Bug report
Bug description:
In #104826 (backported to 3.12 in #105277) to fix #104690 disallowed creating new threads during interpreter finalization. This poses a problem on windows because the
Popen._communicate
uses a thread (see matplotlib/matplotlib#27437 (comment) for discussion).In Matplotlib we are holding onto a latex process and triggering this via a weakref finalize, but a minimal reproducer is:
xref matplotlib/matplotlib#27437
CPython versions tested on:
3.12
Operating systems tested on:
Windows
The text was updated successfully, but these errors were encountered: