-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
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
base: main
Are you sure you want to change the base?
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 |
copy that will fix it |
| # in the module's namespace. | ||
| globs = module.__dict__ | ||
| globs.update({ | ||
| '__spec__': spec, |
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
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~
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
fixed |
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
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