[ python-Bugs-920573 ] http libraries throw errors internally

SourceForge.net noreply at sourceforge.net
Sat Mar 31 21:29:58 CEST 2007


Bugs item #920573, was opened at 2004-03-21 13:16
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=920573&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
>Resolution: None
Priority: 5
Private: No
Submitted By: Bram Cohen (bram_cohen)
Assigned to: Nobody/Anonymous (nobody)
Summary: http libraries throw errors internally

Initial Comment:
Here's an error which someone just got running BitTorrent -

Exception in thread Thread-2:
 Traceback (most recent call last):
   File "/usr/lib/python2.3/threading.py", line 436, in
__bootstrap
     self.run()
   File "/usr/lib/python2.3/threading.py", line 416, in run
     self.__target(*self.__args, **self.__kwargs)
   File
"/usr/lib/python2.3/site-packages/BitTorrent/Rerequester.py",
line 72, in rerequest
     h = urlopen(url)
   File "/usr/lib/python2.3/urllib2.py", line 129, in
urlopen
     return _opener.open(url, data)
   File "/usr/lib/python2.3/urllib2.py", line 326, in open
     '_open', req)
   File "/usr/lib/python2.3/urllib2.py", line 306, in
_call_chain
     result = func(*args)
   File "/usr/lib/python2.3/urllib2.py", line 491, in
<lambda>
     lambda r, proxy=url, type=type,
meth=self.proxy_open: \
   File "/usr/lib/python2.3/urllib2.py", line 498, in
proxy_open
     if '@' in host:
 TypeError: iterable argument required

And here's one which people have been getting
*forever*, without it ever having been fixed (I've been
simply catching and ignoring it) -

Exception in thread Thread-60:
Traceback (most recent call last):
  File "/usr/lib/python2.2/threading.py", line 414, in
__bootstrap
    self.run()
  File "/usr/lib/python2.2/threading.py", line 402, in run
    apply(self.__target, self.__args, self.__kwargs)
  File "/home/zkessin/bin/BitTorrent/Rerequester.py",
line 85, in
rerequest
    r = h.read()
  File "/usr/lib/python2.2/httplib.py", line 1140, in read
    assert not self._line_consumed and self._line_left
AssertionError

Both of the above were caused by very straightforward
calls to httplib. I'm fairly certain (especially with
the second one) that they're internal bugs.

I'd like to mention while I'm at it that I'm extremely
unhappy with httplib. It's buggy, blocking, and doesn't
even support timeouts. While it's good to have a
library which supports all the vagaries of http, it
would be far better for it to be a simple object which
you tell when data  was received and it tells you when
there's data to be sent out. That way it could
integrate easily into other applications's event loops.
The blocking and buggy nature of httplib has caused me
no end of headaches, and I think I'm not the only one.

----------------------------------------------------------------------

>Comment By: Raymond Hettinger (rhettinger)
Date: 2007-03-31 14:29

Message:
Logged In: YES 
user_id=80475
Originator: NO

Both of these still need to be looked at (whether or not Bram supplies
more detail).

----------------------------------------------------------------------

Comment By: Facundo Batista (facundobatista)
Date: 2007-03-31 07:09

Message:
Logged In: YES 
user_id=752496
Originator: NO

For any bug to be solved, we'd need a way to reproduce it.

Thes three points are very useful:

- What do you do
- What do you get
- What do you expect

"this is an error from somebody running bittorrent" is not specific enough
to us to be able to find the bug (if any).

Please, consider detail this a bit more.

Regards,

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=920573&group_id=5470


More information about the Python-bugs-list mailing list