You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#86572 describes a bug where importing multiprocessing causes pickle to determine the wrong module for objects without __module__. #23403 fixed the bug, but only for the pure Python implementation of pickle. The C extension module is still broken.
Importing multiprocessing adds an alias to __main__ named __mp_main__.
In python#23403, the Python version of whichmodule() was fixed to exclude
__mp_main__. Apply the same fix to the C version of the function.
Bug report
Bug description:
#86572 describes a bug where importing
multiprocessing
causespickle
to determine the wrong module for objects without__module__
. #23403 fixed the bug, but only for the pure Python implementation ofpickle
. The C extension module is still broken.Consider a file
foo.py
containing:Then, in an interactive session:
pickle.dumps
tries to importf
from__mp_main__
.pickle._dumps
correctly determines thatf
comes from thefoo
module.CPython versions tested on:
CPython main branch
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: