Uh oh!
There was an error while loading. Please reload this page.
gh-140729: profiling or tracing multiprocessing can cause error - #141874
gh-140729: profiling or tracing multiprocessing can cause error#141874yihong0618 wants to merge 6 commits into
Conversation
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>
@yihong0618 thank you for creating this PR. I was waiting for figure out why or how setting the |
About the |
yihong0618
commented
Nov 25, 2025
copy that will fix it |
| # in the module's namespace. | ||
| globs = module.__dict__ | ||
| globs.update({ | ||
| '__spec__': spec, |
There was a problem hiding this comment.
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.
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.
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
There was a problem hiding this comment.
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.
the original fixed from gaotian do not add it, I follow it style~
There was a problem hiding this comment.
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>
@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! |
YvesDup
commented
Feb 11, 2026
FYI @yihong0618 , I just submitted this PR |

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