[Python-bugs-list] [ python-Bugs-787077 ] copy_reg globals in cPickle

SourceForge.net noreply at sourceforge.net
Mon Aug 11 18:45:19 EDT 2003


Bugs item #787077, was opened at 2003-08-12 12:45
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=787077&group_id=5470

Category: Extension Modules
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Tim McLennan (timmcl)
Assigned to: Nobody/Anonymous (nobody)
Summary: copy_reg globals in cPickle

Initial Comment:
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)



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=787077&group_id=5470



More information about the Python-bugs-list mailing list