This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: http client attempts to send a readable object twice
Type: behavior Stage: resolved
Components: Versions: Python 3.3, Python 3.4
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 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg143227 - (view) Author: Lang Martin (langmartin) Date: 2011-08-30 17:05
on line 765 of client/, 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.
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57069
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