Re: pickle.dump (obj, conn)

2014-03-14 Thread dieter
Pedro Izecksohn izecks...@yahoo.com writes:

   Shouldn't pickle.dump (obj, conn) raise an Exception if conn is a TCP 
 connection that was closed by the remote host?

It is quite difficult to detect the closing of a TCP channel in
a reliable way. At least, you should not trust that you are reliably
informed about it.

The behavior is related to output to TCP connections, not directly
to pickle. 

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


pickle.dump (obj, conn)

2014-03-13 Thread Pedro Izecksohn
  Shouldn't pickle.dump (obj, conn) raise an Exception if conn is a TCP 
connection that was closed by the remote host?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: pickle.dump (obj, conn)

2014-03-13 Thread Ian Kelly
On Thu, Mar 13, 2014 at 4:36 PM, Pedro Izecksohn izecks...@yahoo.com wrote:
   Shouldn't pickle.dump (obj, conn) raise an Exception if conn is a TCP
 connection that was closed by the remote host?

Can you be more specific about what you are doing, what you expect the
result to be, and what the actual result is?

http://www.catb.org/esr/faqs/smart-questions.html#beprecise

If I try using pickle.dump with a socket, I do get an exception, but
perhaps not the one you are looking for:

 pickle.dump([1,2,3], sock)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: file must have a 'write' attribute
-- 
https://mail.python.org/mailman/listinfo/python-list