Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
2xB wants to merge1 commit intopython:main
base:main
Choose a base branch
Loading
from2xB:fix520
Open

Conversation

@2xB
Copy link

@2xB2xB commentedJun 8, 2025
edited
Loading

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

Before, one could get OSError 22 and BadZipFile errors due to re-used file pointers in forked subprocesses.Fixespython#520
Copy link
Member

@jaracojaraco left a 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
Copy link
Author

2xB commentedNov 26, 2025
edited
Loading

@jaraco Good success catching up on Pull Requests! Do I understand correctly that you are working with Copilot on the requested changes?

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@jaracojaracojaraco requested changes

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Issues when combined with multiprocessing (MaybeEncodingError, BadZipFile, OSError)

2 participants

@2xB@jaraco

[8]ページ先頭

©2009-2025 Movatter.jp