You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yet another weird bug when one creates sub-processes from threads.
I found several issues mentioning ThreadPoolExecutor and subprocess.run but I believe this one is different.
When creating a temporary directory with tempfile.TemporaryDirectory (with or without context manager) it is sometimes deleted by a call to subprocess.run when both occurs inside a task sent to a ThreadPoolExecutor created without a context manager (that last part is very odd).
Running the attached file on python 3.8.5 or 3.8.10 shows the issue only occurs if the executor is not created through a context manager.
The bug does not seem to occur on python 3.9.5 or 3.10.0b1.
Using a ProcessPoolExecutor seems to fix the issue too.
Actually, it has nothing to do with subprocess.run, replacing that line with sleep(random()) exhibits the same behavior.
colasleguernicmannequin
changed the title
tempfile.TemporaryDirectory deleted after call to subprocess.run in threads
tempfile.TemporaryDirectory deleted after sleep in threads
May 11, 2021
colasleguernicmannequin
changed the title
tempfile.TemporaryDirectory deleted after call to subprocess.run in threads
tempfile.TemporaryDirectory deleted after sleep in threads
May 11, 2021
I guess this will be a won't fix as python3.8 is now in security-fix only mode.
I was misled by https://www.python.org/downloads/ that still indicates a bugfix maintenance status.
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: