Hi Lars,
On 09.01.14 10:49, lars van Gemerden wrote:
Hi all,
I seem to have problems with pickling and i was wondering whether it
is stackless related (i found a presentation by Anselm Kruis saying
that stackless pickles modules).
It would save some time if you could give us the URL, too.
Did you mean this one from 2011? (archived under 2013)
https://ep2013.europython.eu/conference/talks/advanced-pickling-with-stackless-python-and-spickle
Stackless extends pickling for some types, but does not change it.
When modules are involved, stackless behaves identical to CPython
when the module can be imported.
If a module cannot be imported, then
- CPython pickling crashes
- Stackless pickling saves the module by value.
So I suggest to see if your module is always properly importable,
then the problem should go away.
cheers -- Chris
I found two problems that seem odd to me:
1) if i pickle-save my model, remove a class from my modules and then
load the save, sometimes the unpickler crashed even when the class is
not used in my model (it still looks for the removed class, although i
see no reason the unpickler needs it for the model i saved).
2) If i change a class after saving the model, and then load the model
again, the loaded model seems to use a pre-change class definition.
This means that during testing i need to recreate the model (which can
be quite complex) after any changes to the classes it uses (and even
after removing classes i don't use), even if the change should not
influence the saved and reloaded pickle in any way.
It also means that save files become much more brittle in any
production version of the program.
So my questions are, is this caused by stackless (compared to vanilla
python) and if so, what triggers the pickling of modules and how can i
influence that or use the vanilla version of pickle instead.
Cheers, Lars
--
====================================
Lars van Gemerden
[email protected] <mailto:[email protected]>
+31 6 26 88 55 39
====================================
_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless
--
Christian Tismer :^) <mailto:[email protected]>
Software Consulting : Have a break! Take a ride on Python's
Karl-Liebknecht-Str. 121 : *Starship* http://starship.python.net/
14482 Potsdam : PGP key -> http://pgp.uni-mainz.de
phone +49 173 24 18 776 fax +49 (30) 700143-0023
PGP 0x57F3BF04 9064 F4E1 D754 C2FF 1619 305B C09C 5A3B 57F3 BF04
whom do you want to sponsor today? http://www.stackless.com/
_______________________________________________
Stackless mailing list
[email protected]
http://www.stackless.com/mailman/listinfo/stackless