Pickle virtual machines implemented in other languages?

Ned Batchelder ned at nedbatchelder.com
Tue Oct 29 12:28:37 EDT 2013


On 10/29/13 12:12 PM, Patrick wrote:
> Hi Everyone
>
> I was just wondering if anyone had tried to implement a pickle virtual 
> machine in another language? I was thinking that it might make for a 
> nice little form of cross language IPC within a trusted environment.
>

Pickle can execute class constructors, which is what makes it insecure.  
But this also means that you need to have the class definitions on the 
receiving end, which means the receiving end must be in Python.  Unless 
you special-case some set of Python classes and their equivalents in the 
other language, you are limited to the primitive builtins like string, 
dict, list, float, etc.  In that case, you might as well just use json 
as your transport format.

--Ned.



More information about the Python-list mailing list