This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Mark.Shannon
Recipients Mark.Shannon, frenzy, pablogsal, vstinner
Date 2021-02-15.15:37:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1613403475.66.0.398779699756.issue43228@roundup.psfhosted.org>
In-reply-to
Content
Do you have a reproducer that does not use cloudpickle?

Pickling functions seems to work correctly.

>>> import pickle
>>> def func():
...     return len([])
... 
>>> func2 = pickle.loads(pickle.dumps(func))
>>> 
>>> func2()
0

How is cloudpickle supposed to work? It looks like the globals dict passed to FunctionType(...) lacks a __builtins__.
History
Date User Action Args
2021-02-15 15:37:55Mark.Shannonsetrecipients: + Mark.Shannon, vstinner, frenzy, pablogsal
2021-02-15 15:37:55Mark.Shannonsetmessageid: <1613403475.66.0.398779699756.issue43228@roundup.psfhosted.org>
2021-02-15 15:37:55Mark.Shannonlinkissue43228 messages
2021-02-15 15:37:55Mark.Shannoncreate