ports/74883: Python 2.4 upgrade breaks port net/py-bittorrent [fix included]

Jonathan Lennox lennox at cs.columbia.edu
Thu Dec 9 03:30:22 UTC 2004


>Number:         74883
>Category:       ports
>Synopsis:       Python 2.4 upgrade breaks port net/py-bittorrent [fix included]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Dec 09 03:30:21 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Lennox
>Release:        FreeBSD 5.3-RELEASE-p2 i386
>Organization:
Columbia University
>Environment:
System: FreeBSD cnr.cs.columbia.edu 5.3-RELEASE-p2 FreeBSD 5.3-RELEASE-p2 #9: Sat Dec 4 12:36:03 EST 2004 lennox at cnr.cs.columbia.edu:/usr/obj/usr/src/sys/CNR i386


	
>Description:

After upgrading the port lang/python to version 2.4, the port
net/py-bittorrent is broken.

This appears to be an incompatibility in bittorrent's zurllib.py file; the
patch below has also been sent to the bittorrent development list.

This problem, and the same solution, appears to also apply to the port
net/bittornado.

>How-To-Repeat:
$ btdownloadheadless.py 'http://people.freebsd.org/~scottl/5.3-torrent/5.3-RELEASE-i386-all.torrent'
Traceback (most recent call last):
  File "/usr/local/bin/btdownloadheadless.py", line 163, in ?
    run(argv[1:])
  File "/usr/local/bin/btdownloadheadless.py", line 158, in run
    download(params, h.chooseFile, h.display, h.finished, h.error, Event(), cols, h.newpath)
  File "/usr/local/lib/python2.4/site-packages/BitTorrent/download.py", line 120, in download
    h = urlopen(config['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'

>Fix:

Apply the following patch to net/py-bittorrent:

--- Makefile~	Mon Nov  8 16:08:56 2004
+++ Makefile	Wed Dec  8 22:23:42 2004
@@ -7,7 +7,7 @@
 
 PORTNAME=	BitTorrent
 PORTVERSION=	3.4.2
-PORTREVISION=	1
+PORTREVISION=	2
 PORTEPOCH=	1
 CATEGORIES?=	net python
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE_EXTENDED}
--- /dev/null	Wed Dec  8 22:22:00 2004
+++ files/patch-BitTorrent::zurllib.py	Wed Dec  8 22:23:26 2004
@@ -0,0 +1,18 @@
+--- BitTorrent/zurllib.py.bak	Thu Jun 26 20:40:21 2003
++++ BitTorrent/zurllib.py	Wed Dec  8 22:21:26 2004
+@@ -35,7 +35,14 @@
+         if DEBUG: 
+              pprint.pprint(headers.dict)
+         url = fp.url
+-        return addinfourldecompress(fp, headers, url)
++        resp = addinfourldecompress(fp, headers, url)
++        # As of Python 2.4 http_open response also has 'code' and 'msg'
++        # members, and HTTPErrorProcessor breaks if they don't exist.
++        if 'code' in dir(fp):
++           resp.code = fp.code
++        if 'msg' in dir(fp):
++           resp.msg = fp.msg
++        return resp
+ 
+ 
+ class addinfourldecompress(addinfourl):



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list