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.

classification
Title: copy_reg globals in cPickle
Type: Stage:
Components: Extension Modules Versions:
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, timmcl
Priority: normal Keywords:

Created on 2003-08-12 00:45 by timmcl, last changed 2022-04-10 16:10 by admin. This issue is now closed.

Messages (2)
msg60370 - (view) Author: Tim McLennan (timmcl) Date: 2003-08-12 00:45
I'm not sure if it's a bug as such, but the following
behaviour can be rather annoying if you're playing
around with copy_reg.

On intialisation cPickle creates local copies of the
'dispatch_table', '_extension_registry',
'_extension_cache', and '_inverted_registry'
dictionaries from the copy_reg module.  If that module
is reloaded the dictionaries are reinitialised, and so
out of sync with the copies in the cPickle modules,
which one access from python.

thus the following code results in an Unpicklable
exception.

import cPickle
import copy_reg
reload(copy_reg)
import Numeric
cPickle.dumps(Numeric.array([10,10,01]),1)

msg70085 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-07-20 11:35
I'll declare this is not a bug; reload() isn't very safe in many contexts.
History
Date User Action Args
2022-04-10 16:10:35adminsetgithub: 39050
2008-07-20 11:35:34georg.brandlsetstatus: open -> closed
resolution: wont fix
messages: + msg70085
nosy: + georg.brandl
2003-08-12 00:45:19timmclcreate