[New-bugs-announce] [issue6005] Bug in socket example

Mads Kiilerich report at bugs.python.org
Tue May 12 16:19:05 CEST 2009

New submission from Mads Kiilerich <mads at kiilerich.com>:

http://docs.python.org/library/socket.html says about socket.send:
"Applications are responsible for checking that all data has been sent;
if only some of the data was transmitted, the application needs to
attempt delivery of the remaining data."

And about socket.sendall:
"Unlike send(), this method continues to send data from string until
either all data has been sent or an error occurs."

However, the examples on the same page uses plain conn.send(data)
without checking anything. That is misleading.

A solution could be to use conn.sendall(data) instead.

assignee: georg.brandl
components: Documentation
messages: 87633
nosy: georg.brandl, kiilerix
severity: normal
status: open
title: Bug in socket example
type: behavior
versions: Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list