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

bpo-42406: Fix whichmodule() with multiprocessing#23403

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

Merged
gpshead merged 2 commits intopython:masterfromrenatolfc:fix-issue-42406
Nov 29, 2020

Conversation

renatolfc
Copy link
Contributor

@renatolfcrenatolfc commentedNov 19, 2020
edited by miss-islington
Loading

This fixes the behavior of thepickle.whichmodule() function whenmultiprocessing is imported before thepickle module.

Prior to this patch, the following incorrect output would be found when trying to determine the module of the (for example)gdtrix function:

>>> import multiprocessing>>> import pickle>>> from scipy.special import gdtrix>>> pickle.whichmodule(gdtrix, gdtrix.__name__)'__mp_main__'

With the patch, now we get correct behavior:

>>> import multiprocessing>>> import pickle>>> from scipy.special import gdtrix>>> pickle.whichmodule(gdtrix, gdtrix.__name__)'scipy.special._ufuncs'

This alsofixesuqfoundation/dill#392.

Signed-off-by: Renato L. de F. Cunharenatoc@br.ibm.com

https://bugs.python.org/issue42406

Automerge-Triggered-By: GH:gpshead

Signed-off-by: Renato L. de F. Cunha <renatoc@br.ibm.com>
@the-knights-who-say-ni

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed thePSF contributor agreement (CLA).

CLA Missing

Our records indicate the following people have not signed the CLA:

@renatolfc

For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please followthe steps outlined in the CPython devguide to rectify this issue.

If you have recently signed the CLA, please wait at least one business day
before our records are updated.

You cancheck yourself to see if the CLA has been received.

Thanks again for the contribution, we look forward to reviewing it!

Copy link
Member

@gpsheadgpshead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

i made one minor edit to mentionbpo-42406 in a comment and prefer () over .

renatolfc reacted with thumbs up emoji
@miss-islington
Copy link
Contributor

@renatolfc: Status check is done, and it's a success ❌ .

@gpsheadgpshead reopened thisNov 28, 2020
@miss-islington
Copy link
Contributor

@renatolfc: Status check is done, and it's a success ❌ .

2 similar comments
@miss-islington
Copy link
Contributor

@renatolfc: Status check is done, and it's a success ❌ .

@miss-islington
Copy link
Contributor

@renatolfc: Status check is done, and it's a success ❌ .

@gpsheadgpshead merged commit8668431 intopython:masterNov 29, 2020
@miss-islington
Copy link
Contributor

Thanks@renatolfc for the PR, and@gpshead for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8, 3.9.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestNov 29, 2020
* bpo-42406: Fix whichmodule() with multiprocessingSigned-off-by: Renato L. de F. Cunha <renatoc@br.ibm.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>(cherry picked from commit8668431)Co-authored-by: Renato Cunha <renatocunha@acm.org>
@bedevere-botbedevere-bot removed the needs backport to 3.9only security fixes labelNov 29, 2020
@bedevere-bot
Copy link

GH-23560 is a backport of this pull request to the3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestNov 29, 2020
* bpo-42406: Fix whichmodule() with multiprocessingSigned-off-by: Renato L. de F. Cunha <renatoc@br.ibm.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>(cherry picked from commit8668431)Co-authored-by: Renato Cunha <renatocunha@acm.org>
@bedevere-bot
Copy link

GH-23561 is a backport of this pull request to the3.8 branch.

miss-islington added a commit that referenced this pull requestNov 29, 2020
*bpo-42406: Fix whichmodule() with multiprocessingSigned-off-by: Renato L. de F. Cunha <renatoc@br.ibm.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>(cherry picked from commit8668431)Co-authored-by: Renato Cunha <renatocunha@acm.org>
miss-islington added a commit that referenced this pull requestNov 29, 2020
*bpo-42406: Fix whichmodule() with multiprocessingSigned-off-by: Renato L. de F. Cunha <renatoc@br.ibm.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>(cherry picked from commit8668431)Co-authored-by: Renato Cunha <renatocunha@acm.org>
@renatolfcrenatolfc deleted the fix-issue-42406 branchNovember 29, 2020 19:13
adorilson pushed a commit to adorilson/cpython that referenced this pull requestMar 13, 2021
* bpo-42406: Fix whichmodule() with multiprocessingSigned-off-by: Renato L. de F. Cunha <renatoc@br.ibm.com>Co-authored-by: Gregory P. Smith <greg@krypto.org>
faucct added a commit to faucct/cpython that referenced this pull requestSep 21, 2021
li-dan pushed a commit to li-dan/cpython that referenced this pull requestJun 6, 2024
Importing multiprocessing adds an alias to __main__ named __mp_main__.Inpython#23403, the Python version of whichmodule() was fixed to exclude__mp_main__. Apply the same fix to the C version of the function.
li-dan added a commit to li-dan/cpython that referenced this pull requestJan 29, 2025
Importing multiprocessing adds an alias to __main__ named __mp_main__.Inpython#23403, the Python version of whichmodule() was fixed to exclude__mp_main__. Apply the same fix to the C version of the function.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@gpsheadgpsheadgpshead approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Serialization ofufuncs breaks depending on import order
5 participants
@renatolfc@the-knights-who-say-ni@miss-islington@bedevere-bot@gpshead

[8]ページ先頭

©2009-2025 Movatter.jp