From: SourceForge.net <no...@so...> - 2006-07-28 09:36:25
|
Bugs item #1530257, was opened at 2006-07-28 15:06 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1530257&group_id=12867 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Anand Pillai (abpillai) Assigned to: Nobody/Anonymous (nobody) Summary: Jython 2.2 cannot pickle types Initial Comment: 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. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112867&aid=1530257&group_id=12867 |