Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork93
Fix errors with multiprocessing#521
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Before, one could get OSError 22 and BadZipFile errors due to re-used file pointers in forked subprocesses.Fixespython#520
jaraco left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Looks good. I especially like that the behavior is essentially a no-op except in the affected scenario.
I don't love that the code is detached from its locus of effect, and while the comments help, I'd prefer if we could model the effect in Python syntax, such as a decorator around functools.lru_cache(new) that performs the registration. That decorator could also have a docstring capturing the narrative currently in comments.
The other thing that would be nice to have is a regression test (a test that would replicate the failure with the workaround removed). It might be a little tricky, as the repro steps described in the issue were intermittent, but if it's possible, we should add one that guarantees that multiprocessing usage works in the supported scenarios. Let's try to put together a test to capture the failure. That test should fail on main and pass in this PR.
2xB commentedNov 26, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
@jaraco Good success catching up on Pull Requests! Do I understand correctly that you are working with Copilot on the requested changes? |
Uh oh!
There was an error while loading.Please reload this page.
Before, one could get OSError 22 and BadZipFile errors due to re-used file pointers in forked subprocesses.
This implements the fix recommended by@anntzer .
Fixes#520