On 3/6/07, Adam Olsen <[EMAIL PROTECTED]> wrote: > What's the rationale for IOError instead of ValueError? Isn't it an > error in the application to apply the buffering layer to a > non-blocking socket, and not something related to a connection reset?
The buffering layer can't easily detect that the file object is non-blocking a priori. It only finds out when a system call returns -1 and errno is set to EAGAIN. In the meantime, it might have actually read or writen some data. An IOError makes it more clear that something went awry, while a ValueError typically implies that the operation was rejected altogether. -- Daniel Stutzbach, Ph.D. President, Stutzbach Enterprises LLC _______________________________________________ Python-3000 mailing list Python-3000@python.org http://mail.python.org/mailman/listinfo/python-3000 Unsubscribe: http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com