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.

classification
Title: http libraries throw errors internally in BitTorrent
Type: behavior Stage: test needed
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: rhettinger Nosy List: ajaksu2, bram_cohen, facundobatista, rhettinger, vila
Priority: normal Keywords:

Created on 2004-03-21 18:16 by bram_cohen, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (7)
msg20279 - (view) Author: Bram Cohen (bram_cohen) Date: 2004-03-21 18:16
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.
msg20280 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2007-03-31 12:09
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,
msg20281 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2007-03-31 19:29
Both of these still need to be looked at (whether or not Bram supplies more detail).
msg59330 - (view) Author: Facundo Batista (facundobatista) * (Python committer) Date: 2008-01-05 20:12
A lot of water passed through httplib.py. A lot of people made
corrections from Python versions 2.2 and 2.3.

Even me. I added timeout to it. And fixed recently (r58530) a problem
that could generate the second exception.

But how can check if this is solved?
msg87793 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-05-15 03:00
I think we should close this, otherwise we'll have to get creative
trying to find bugs that might as well have been fixed.
msg87795 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-05-15 07:04
I'll take another look at it the week.
msg88038 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-05-18 16:55
It looks like both pieces of offending code were changed long ago.  No
new bug reports have surfaced since then.
History
Date User Action Args
2022-04-11 14:56:03adminsetgithub: 40059
2009-05-18 16:55:35rhettingersetstatus: open -> closed
resolution: out of date
messages: + msg88038
2009-05-15 07:04:49rhettingersetstatus: pending -> open
assignee: rhettinger
messages: + msg87795
2009-05-15 03:00:14ajaksu2setstatus: open -> pending
nosy: + ajaksu2
messages: + msg87793

2009-02-14 11:33:28ajaksu2setversions: - Python 2.5
stage: test needed
type: behavior
title: http libraries throw errors internally -> http libraries throw errors internally in BitTorrent
2008-01-05 20:12:04facundobatistasetmessages: + msg59330
2008-01-05 19:58:38christian.heimessetversions: + Python 2.6, Python 2.5
2008-01-05 13:20:04vilasetnosy: + vila
2004-03-21 18:16:09bram_cohencreate