Send a Class Object by Socket

Alex Martelli aleax at
Tue Jan 8 11:53:07 EST 2002

"Hugo Martires" <hugomartires at> wrote in message
news:d0380df9.0201080844.766e4a00 at
> But the server give's me this error:
>  File "./", line 41, in ?
>     CliSock.send(cPickle.dumps(vp_master) )
> cPickle.PicklingError: Cannot pickle <type 'array'> objects.
> Do you know ho to picke an array ?

Not very elegant, maybe, but vp_master.tostring() is
a fully pickleable string of bytes (and the fromstring
method lets you go the other way 'round... although
the typecode character to be used must be passed on
its own, as it's not recoverable from the string).


More information about the Python-list mailing list