Message63091
| Author | pyscripter |
|---|---|
| Recipients | pyscripter |
| Date | 2008-02-28.13:46:22 |
| SpamBayes Score | 0.010332968 |
| Marked as misclassified | No |
| Message-id | <1204206384.27.0.149974738498.issue2199@psf.upfronthosting.co.za> |
| In-reply-to |
| Content | |
|---|---|
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 gtk
##import pickle
import cPickle as pickle
simple_types = (
bool,
int,
long,
float,
complex,
basestring,
type(None),
)
d = vars(gtk)
for (i,j) in d.iteritems():
if isinstance(j, simple_types):
try:
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. |
|
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2008-02-28 13:46:24 | pyscripter | set | spambayes_score: 0.010333 -> 0.010332968 recipients: + pyscripter |
| 2008-02-28 13:46:24 | pyscripter | set | spambayes_score: 0.010333 -> 0.010333 messageid: <1204206384.27.0.149974738498.issue2199@psf.upfronthosting.co.za> |
| 2008-02-28 13:46:23 | pyscripter | link | issue2199 messages |
| 2008-02-28 13:46:22 | pyscripter | create | |