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 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. ---------- components: Library (Lib) messages: 63091 nosy: pyscripter severity: normal status: open title: cPickle error with gtk GEnum classes versions: Python 2.5 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2199> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com