[Python-Dev] noreply@sourceforge.net: [Python-bugs-list] [Bug #111620] lots of use of send() without verifyi ng amount of data sent.

Thomas Wouters thomas@xs4all.net
Fri, 11 Aug 2000 14:31:43 +0200


On Fri, Aug 11, 2000 at 07:55:29AM -0500, Guido van Rossum wrote:

> I just noticed this.  Is this true?  Shouldn't we change send() to
> raise an error instead of returning a small number?  (The number of
> bytes written can be an attribute of the exception.)

This would break a lot of code. (probably all that use send, with or without
return-code checking.) I would propose a 'send_all' or some such instead,
which would keep sending until either a real error occurs, or all data is
sent (possibly with a timeout ?). And most uses of send could be replaced by
send_all, both in the std. library and in user code.

-- 
Thomas Wouters <thomas@xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!