[New-bugs-announce] [issue2199] cPickle error with gtk GEnum classes
report at bugs.python.org
Thu Feb 28 14:46:24 CET 2008
New submission from PyScripter:
cPickle has problems loading instances of gtk gobject.GEnum classes.
gobject.GEnum is a subclass of int. On the other hand pickle handles
those classes correctly. Since cPickle is meant to be a faster version
of pickle this needs to be consider a bug.
To test run the following script:
import cPickle as pickle
simple_types = (
d = vars(gtk)
for (i,j) in d.iteritems():
if isinstance(j, simple_types):
s = pickle.dumps(j, pickle.HIGHEST_PROTOCOL)
obj = pickle.loads(s)
except (ValueError, TypeError):
print j, type(j)
If you replace cPickle with pickle then the script runs fine.
components: Library (Lib)
title: cPickle error with gtk GEnum classes
versions: Python 2.5
Tracker <report at bugs.python.org>
More information about the New-bugs-announce