by nurettin · 6y ago · 0 comments
* Old pickles look like old code: Again, convert your object into json and serialize that to your database. Oh no, you are missing an attribute. Pickle should not be used so you don't have to employ a release engineer.
* Implicit: No software works everywhere with defaults. So use copyreg.
* Over-serializes: USE copyreg.
* __init__ isn’t called: USE COPYREG.
* Python only: what's this for, then? http://www.picklingtools.com/
* Unreadable: Great feature.
* Appears to pickle code: Another great feature.
* Slow: check again, it has been 8 years. I can't find any faster method.
From the picklingtools FAQ:
What versions of Python does PicklingTools support? Historically, versions 2.1.x to 2.6.x have been tested extensively. More recently, 2.7 has been tested and should work, but it has not been tested as much as the other versions.
3.x has not been tested: We are waiting for our main paying customer to adopt the 3.x series.
[edit] formattingThere are lots of good use cases for deserializing untrusted data -- it's what you do in almost any client-server situation. So the fact you can't do this with pickle really is an important limitation.
Yes, and untrusted user data should not have arrived at the system in pickle format. And in case of RoR, it should not have arrived in YAML format or loaded with YAML.load[1] So my point stands.
[1] https://gist.github.com/niklasb/df9dba3097df536820888aeb4de3...
The article is, after all, about reasons not to use pickle. :-)
???