Pickle file and send via socket
Christian Heimes
lists at cheimes.de
Mon Aug 6 12:45:58 EDT 2012
Am 06.08.2012 15:32, schrieb S.B:
> Does anyone know if it's possible to pickle and un-pickle a file across a network socket. i.e:
> First host pickles a file object and writes the pickled file object to a client socket.
> Second host reads the pickled file object from the server socket and un-pickles it.
Have you read the warning in the first paragraph of the pickle docs?
Pickles are a major security risk unless both hosts are trustworthy and
are either inside a protected network or are connected over a secure line.
http://docs.python.org/library/pickle.html#module-pickle
Warning
The pickle module is not intended to be secure against erroneous or
maliciously constructed data. Never unpickle data received from an
untrusted or unauthenticated source.
Christian Heimes
More information about the Python-list
mailing list