Issue 920573: http libraries throw errors internally in BitTorrent (original) (raw)

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 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.

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

Thes three points are very useful:

"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,