Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-140729: profiling or tracing multiprocessing can cause error#141874
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
yihong0618 commented Nov 23, 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.
Signed-off-by: yihong0618 <zouzou0208@gmail.com> Co-Authored-By: YvesDup <yduprat@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
YvesDup commented Nov 24, 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.
@yihong0618 thank you for creating this PR. I was waiting for figure out why or how setting the |
YvesDup commented Nov 24, 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.
About the |
yihong0618 commented Nov 25, 2025
copy that will fix it |
| # in the module's namespace. | ||
| globs=module.__dict__ | ||
| globs.update({ | ||
| '__spec__': spec, |
YvesDupDec 1, 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.
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.
By removing spec value to the __spec__key, does the comment above still apppropriate ?
Should not we replace it here with a reference to the issue and @gaogaotiantian original fix ?
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.
So my original "source" is https://docs.python.org/3/reference/import.html#module-specs - where it says the __main__ module normally sets __spec__ to None. But it's for my individual project so as long as it works it's fine. Not sure about the very accurate and official answer.
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.
By removing
specvalue to the__spec__key, does the comment above still apppropriate ? Should not we replace it here with a reference to the issue and @gaogaotiantian original fix ?
remove is not right still fail...we the right is set it to None
YvesDupDec 3, 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.
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.
remove is not right still fail...we the right is set it to None
You are right.
How about adding a comment such as:
See gh-140729: set None to __spec__ according to the documentation (https://docs.python.org/3/reference/import.html#module-specs)
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.
the original fixed from gaotian do not add it, I follow it style~
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.
Such a shame, add a comment might be helpful.
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
yihong0618 commented Dec 3, 2025
fixed |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
YvesDup commented Dec 17, 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.
@yihong0618 Why did you close this PR ? |
yihong0618 commented Dec 17, 2025
![]() I am such a fool..... |
YvesDup commented Dec 17, 2025
@yihong0618 may I help you ? |
yihong0618 commented Dec 17, 2025
of course you can continue it |
YvesDup commented Dec 18, 2025
I'm going to take a break for the next two weeks. If you're not in a hurry, I'll be back in early January 2026 with a new PR. |
yihong0618 commented Dec 18, 2025
Merry Christmas in advance! |

This patch fix can not cporfile or profile with multiprocessing
add Co-author @YvesDup with credit.
and this patch is also expert @gaogaotiantian 's fix idea more can check: #116141