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
pdb & multiprocessing.Pool: AttributeError: module '__main__' has no attribute '__spec__' #87115
Comments
Summary: multiprocessing.Pool contains a bug when the script is invoked with pdb. Steps to reproduce: Consider the following script:
When called as When called as
I can reproduce this in Python 3.8.7, 3.9.1, 3.10.0a3. It works fine in Python 3.7.9. A workaround is to define
I'd say that multiprocessing/spawn.py", line 183, in get_preparation_data is flawed |
This is very frustrating. Having the same issue |
This does not reproduce in 3.11/3.13. Consider it as fixed. |
@gaogaotiantian If you run the following program with import multiprocessing
def f(x):
return x * x
if __name__ == "__main__":
context = multiprocessing.get_context("forkserver")
context.Process(target=f, args=(1,)).start() Setting |
Okay now this is really fixed :) |
(cherry picked from commit ccfc042)
…onGH-116141) (cherry picked from commit ccfc042) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
(cherry picked from commit ccfc042)
…onGH-116141) (cherry picked from commit ccfc042) Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
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:
Linked PRs
__main__.__spec__
toNone
in pdb #116141__main__.__spec__
toNone
in pdb (GH-116141) #116154__main__.__spec__
toNone
in pdb (GH-116141) #116155The text was updated successfully, but these errors were encountered: