Issue2483

classification
Title: Serialized form incompatibility of PyObject between versions 2.5 & 2.7
Type: Severity: normal
Components: Core Versions: Jython 2.7
Milestone: Jython 2.7.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: alvarg, jsaiz, zyasoft
Priority: Keywords:

Created on 2016-03-10.10:44:13 by jsaiz, last changed 2017-02-27.04:44:47 by zyasoft.

Messages
msg10812 (view) Author: Jaime (jsaiz) Date: 2016-03-10.10:44:13
PyObject implements Serializable, but it does not define a serialVersionUID.

As its serialized form has changed and the serialVersionUID is automatically generated, PyObject or any subclass serialized with Jython 2.5 is no longer readable with Jython 2.7.

Possibly adding this explicit serialVersionUID to PyObject in Jython 2.7 could solve the issue:

private static final long serialVersionUID = -5518487409570819225L;

We could not try it because org.python.core.PyObject is a special class in the sense that it needs to be compiled with a custom compiler that takes into account annotations to generate auxiliary classes.

Any fix or workaround would be welcome.
msg10842 (view) Author: Jim Baker (zyasoft) Date: 2016-04-27.21:43:43
Agreed, we should add the serialVersionUID here. Using 2.5's version sounds reasonable. I expect, without actually trying it out, that changes to PyObject should be backwards compatible to 2.5, and forward compatible to 2.7.
msg10950 (view) Author: Jim Baker (zyasoft) Date: 2016-09-14.16:21:22
Revisit for possible inclusion in 2.7.1
msg10986 (view) Author: Jim Baker (zyasoft) Date: 2016-11-14.06:19:20
Let's revisit in 2.7.2 - I'm not sure of the nuances here, and especially of the stability of the contract this is committing Jython (and its developers) to for PyObject and its subclasses.
History
Date User Action Args
2017-02-27 04:44:47zyasoftsetassignee: zyasoft ->
2016-11-14 06:19:20zyasoftsetmessages: + msg10986
milestone: Jython 2.7.1 -> Jython 2.7.2
2016-09-14 16:21:23zyasoftsetassignee: zyasoft
messages: + msg10950
milestone: Jython 2.7.1
2016-04-27 21:43:43zyasoftsetnosy: + zyasoft
messages: + msg10842
2016-04-13 12:18:06alvargsetnosy: + alvarg
2016-03-10 10:44:13jsaizcreate