Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #42251

Re: HTTPConnection.send

References <64ae9389-ef1b-4852-94a9-7cc5c228238c@googlegroups.com>
Date 2013-03-30 01:58 +1100
Subject Re: HTTPConnection.send
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.3952.1364569116.2939.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Mar 29, 2013 at 11:27 PM,  <dspublic@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

HTTPConnection.send dspublic@freemail.hu - 2013-03-29 05:27 -0700
  Re: HTTPConnection.send dspublic@freemail.hu - 2013-03-29 06:40 -0700
  Re: HTTPConnection.send Peter Otten <__peter__@web.de> - 2013-03-29 15:49 +0100
  Re: HTTPConnection.send Chris Angelico <rosuav@gmail.com> - 2013-03-30 01:58 +1100
  Re: HTTPConnection.send dspublic@freemail.hu - 2013-03-29 09:32 -0700

csiph-web