From: Peter M. <Pe...@re...> - 2003-01-14 04:05:07
|
I am converting/"porting" a Python program (which runs :-)) to Jython. The original uses the pickle module quite heavily. I have been experiencing the following problems: 1. I can't read any of the pickled files created using Python using the same python module/class running under Jython 2. When I convert the instance data and re-read it into a class instance (under Jython), pickle it and then attempt to load the pickled instance, I get inconsistent results i.e. sometimes the exact same program will load the class instance data, pickle it OK to file and then load it OK from that file and other times it will fail on the load. The reason this behaviour is being noticed is that I have about 50 instances of class data, when I "convert" it into Jython the problem seems to be with different sets of instances each run. Questions: 1. Has anyone any advise/experience with porting Python programs that use pickle to Jython? Should I be able to expect to load the pickle'd instance data from a Python run using the same module running under Jython? i.e. without performing the conversion that I have written. 2. Any ideas as to why the same process i.e. reading in instance data, pickle.dump and then pickle.load fails on some sets of instance data and not others? Any good ideas on how to debug problems with pickle? :-) I have attempted to narrow down any offending lines/pieces of data in the conversion programs on class instances that display the failure to no avail i.e. using a class instance that displayed the problem, I then used the binary search method to attempt to isolate which specific piece of data was the problem - at first the problem was there, but as I narrowed down the problem went away! :-( I strongly suspect the problem is in the pickle.dump process as once an set of instance data is able to be loaded, then I can repeatedly load it time and time again. I have downloaded and installed the latest Jython nightly source code, so I have the latest version of everything (including pickle) but this hasn't solved the problem - the same problem(s) are present using Jython 2.1 or Jython (nightly). Thanks Peter Peter Milliken Software Engineer ResMed Phone: +61 2 9886-5059 Warning: Copyright ResMed. Where the contents of this email and/or attachment includes materials prepared by ResMed, the use of those materials is subject exclusively to the conditions of engagement between ResMed and the intended recipient. This communication is confidential and may contain legally privileged information. By the use of email over the Internet or other communication systems, ResMed is not waiving either confidentiality of, or legal privilege in,the content of the email and of any attachments. If the recipient of this message is not the intended addressee, please call ResMed immediately on +61 2 9886 5000 Sydney, Australia. |