Issue 1167397: Python 2.4 causes BitTorrent 3.4.2 failure (original) (raw)

The following failure messages gets dumped out of BitTorrent 3.4.2 when run against Python 2.4:

Traceback (most recent call last): File "/usr/local/lib/python2.4/threading.py", line 442, in __bootstrap self.run() File "/usr/local/lib/python2.4/threading.py", line 422, in run self.__target(*self.__args, **self.__kwargs) File "/home/andrewl/python/lib/python2.4/site-packages/BitTorrent/Rerequester.py", line 84, in rerequest h = urlopen(url) File "/usr/local/lib/python2.4/urllib2.py", line 130, in urlopen return _opener.open(url, data) File "/usr/local/lib/python2.4/urllib2.py", line 364, in open response = meth(req, response) File "/usr/local/lib/python2.4/urllib2.py", line 468, in http_response code, msg, hdrs = response.code, response.msg, response.info() AttributeError: addinfourldecompress instance has no attribute 'code'

Logged In: YES user_id=752864

The same BitTorrent version works just fine under 2.3.5.

addinfourldecompress is a BitTorrent object which inherits from Python's addinfourl in urllib.py.

The following comment was found in a patch that attempted to work around the issue:

As of Python 2.4 http_open response also has 'code' and 'msg'

members, and HTTPErrorProcessor breaks if they don't exist.

This problem has been cited in a couple of different contexts. I saw it in a bug report for bittornado on FreeBSD. I also saw it in a RedHat list concerning breakage in the yum utility.

Annoyingly, nobody seems to have filed it upstream with the Python folks.