classification
Title: http client attempts to send a readable object twice
Type: behavior Stage: resolved
Components: Versions: Python 3.3, Python 3.4
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Missing "return" in HTTPConnection.send()
View: 16658
Assigned To: Nosy List: BreamoreBoy, langmartin, orsenthil
Priority: normal Keywords:

Created on 2011-08-30 17:05 by langmartin, last changed 2014-06-25 19:59 by ned.deily. This issue is now closed.

Messages (2)
msg143227 - (view) Author: Lang Martin (langmartin) Date: 2011-08-30 17:05
on line 765 of client/http.py, the client loops over the read method, sending it's content to the web server. It appears as though the send method should return at this point; instead it falls through and attempts to send the data object through first self.sock.sendall, falling back to the iterable interface.

The result is that a readable data object must support a null __iter__ method, or if it supports both a working read and __iter__, the data will be sent to the server twice.

Change the break on line 768 to a return, and the expected behavior happens.
msg221567 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-25 18:32
This looks identical to the problem fixed on #16658.
History
Date User Action Args
2014-06-25 19:59:01ned.deilysetstatus: open -> closed
superseder: Missing "return" in HTTPConnection.send()
stage: resolved
resolution: duplicate
versions: + Python 3.3, Python 3.4, - Python 3.2
2014-06-25 18:32:49BreamoreBoysetnosy: + BreamoreBoy
messages: + msg221567
2011-09-02 16:56:08eric.araujosetnosy: + orsenthil
2011-08-30 17:05:30langmartincreate