En Thu, 18 Oct 2007 19:21:15 -0300, milan_sanremo  
<[EMAIL PROTECTED]> escribió:

> I've read the library entry for pickle a couple of times, and I'm
> still not
> sure what data is maintained when an item is pickled and sent over a
> socket.

For most "normal" objects, all their instance attributes are stored.

> pickledMailbag = cPickle.dump(mb, HIGHEST_PROTOCOL)

Please copy&paste actual code when posting, don't retype it...
The above line should read cPickle.dumps, I presume.

> while 1:
>     pickledData = conn.recv(1024)
>     if not pickledData break

Instead of reinventing the wheel again, I'd try to use the existing server  
classes in the standard library, like SimpleHTTPServer by example. Among  
other things, you are not accumulating pickledData.

> mb = cPickle.load(pickledData)
>
> At this point, does mb contain a dictionary with the two envelopes
> with
> their data?

Asuming you managed to get pickledData right, and you use cPickle.loads:  
yes, mb should contain the same things as the original.

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to