HTTPConnection.send

Chris Angelico rosuav at gmail.com
Fri Mar 29 15:58:28 CET 2013


On Fri, Mar 29, 2013 at 11:27 PM,  <dspublic at freemail.hu> wrote:
> I have a problem with HTTPConnection object send() method (pyver3.3.1). I want to send data from file-like object with HTTPConnection.send( f ), and I get a "data should be a bytes-like object or an iterable, ..." exception. I have investigated a send method, and discovered a problem: if data has a read attribute, send it , and try send it again with self.sock.sendall(data). My opinion is need an "else" after the "if hasattr(data, "read")"
>
> Please, somebody help me. Does it a real BUG or my mistake?

Yeah, I think you may be right on that. Changeset 67046 added the try
block, and removed the else. I'd raise this on the tracker; I'd say
the removal of else was purely accidental.

ChrisA



More information about the Python-list mailing list