Message1182

Author abpillai
Recipients
Date 2006-07-28.09:36:23
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
There is a problem pickling types in Jython 2.2. 

anand@localhost:/opt/jython-2.2$ ./jython
Jython 2.2a1 on java1.5.0_06 (JIT: null)
Type "copyright", "credits" or "license" for more
information.
>>> import pickle
>>> pickle.dumps(int)
Traceback (innermost last):
  File "<console>", line 1, in ?
  File "/opt/jython-2.2/Lib/pickle.py", line 978, in dumps
  File "/opt/jython-2.2/Lib/pickle.py", line 115, in dump
  File "/opt/jython-2.2/Lib/pickle.py", line 185, in save
PicklingError: can't pickle 'type' object: <type 'int'>
>>> import cPickle
>>> cPickle.dumps(int)
Traceback (innermost last):
  File "<console>", line 1, in ?
UnpickleableError: Cannot pickle <type 'int'> objects

Type pickling used to work fine in Jython 2.1 .

Scenario:

We are using PyLinda in Jython environment for a
European project (EIAO). PyLinda requires support for
pickling types. However, since it also needs
generators, we have to use Jython 2.2. Due to the bug
above, we are using a patched pickle.py to work around it.

However the problem seems to be an issue with
type/class unification in Jython and needs to be fixed
in Jython core.
History
Date User Action Args
2008-02-20 17:17:31adminlinkissue1530257 messages
2008-02-20 17:17:31admincreate