Serializing functions

Matteo Landi landimatte at gmail.com
Thu Jun 17 11:20:01 EDT 2010


On Thu, 2010-06-17 at 07:37 -0700, Paul Rubin wrote:
> Matteo Landi <landimatte at gmail.com> writes:
> > If you try and pickle a function, it is not pickled as a whole,
> > indeed, once you unpickle it, it will raise an exception telling you
> > that the target function was not found in the current module.
> >
> > So I'm here, with nothing in my hands; how would you implement this?
> 
> Use marshal rather than pickle.  Note that requires both ends to be

I could be wrong, but it seems functions are not marshable objects, is
it right?

> running the same python version.  Be aware of the obvious security
> issues of running code that came from remote machine, either because the
> remote machine itself may be untrusted or compromised, or because the
> network between the two machines may be compromised (remote machine is
> being spoofed or commnications are being modified).

-- 
Matteo Landi
http://www.matteolandi.net




More information about the Python-list mailing list