To fix apt-p2p with latest python-apt package, you need to edit AptPackage.py. Change the import statement in line 40:

FROM:

from apt import OpProgress

TO:

from apt.progress.base import OpProgress

This should bring apt-p2p back to live. :)

And currently my freshly started peer can still see 45 peers (including 2 of my own).


I copy those errors here, 0.1.5 is apt-p2p version:


2010-01-07 21:10:50+0100 [-] Failed to connect to the peer by HTTP.
2010-01-07 21:10:50+0100 [-] Unhandled Error
        Traceback (most recent call last):
        Failure: twisted.internet.error.ConnectionRefusedError: Connection was refused by other side: 111: Connection refused.

2010-01-07 21:10:50+0100 [-] Got error for piece 0 from peer ('188.109.251.228', 9978, 0.0098467497882041392)

2010-01-07 21:14:41+0100 [-] Finished with piece 2 from peer ('88.179.60.147', 9977, 1.4190462316029427e-08)
2010-01-07 21:14:41+0100 [LoggingHTTPClientProtocol,client] Streaming error
2010-01-07 21:14:41+0100 [LoggingHTTPClientProtocol,client] Unhandled Error
        Traceback (most recent call last):
          File "/usr/lib/python2.5/site-packages/twisted/web2/stream.py", line 662, in write
            deferred.callback(data)
          File "/usr/lib/python2.5/site-packages/twisted/internet/defer.py", line 243, in callback
            self._startRunCallbacks(result)
          File "/usr/lib/python2.5/site-packages/twisted/internet/defer.py", line 312, in _startRunCallbacks
            self._runCallbacks()
          File "/usr/lib/python2.5/site-packages/twisted/internet/defer.py", line 328, in _runCallbacks
            self.result = callback(self.result, *args, **kw)
        ---  ---
          File "/usr/lib/python2.5/site-packages/twisted/web2/stream.py", line 421, in _gotData
            self.gotDataCallback(data)
          File "/usr/lib/pymodules/python2.5/apt_p2p/Streams.py", line 247, in _gotData
            raise StreamsError, "outFile was unexpectedly closed"
        apt_p2p.Streams.StreamsError: outFile was unexpectedly closed

2010-01-07 21:14:41+0100 [LoggingHTTPClientProtocol,client] Error streaming piece 2 from peer ('93.121.181.61', 9977, 8.2570465
554689474e-151): >

2010-01-07 21:19:31+0100 [-] Streaming error
2010-01-07 21:19:31+0100 [-] Unhandled Error
        Traceback (most recent call last):
          File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 1128, in run
            self.mainLoop()
          File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 1137, in mainLoop
            self.runUntilCurrent()
          File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 757, in runUntilCurrent
            call.func(*call.args, **call.kw)
          File "/usr/lib/python2.5/site-packages/twisted/web2/stream.py", line 407, in _read
            self._gotData(result)
        ---  ---
          File "/usr/lib/python2.5/site-packages/twisted/web2/stream.py", line 421, in _gotData
            self.gotDataCallback(data)
          File "/usr/lib/pymodules/python2.5/apt_p2p/Streams.py", line 247, in _gotData
            raise StreamsError, "outFile was unexpectedly closed"
        apt_p2p.Streams.StreamsError: outFile was unexpectedly closed

2010-01-07 21:19:31+0100 [-] Error occurred downloading http://ftp2.de.debian.org/debian/pool/main/o/openjdk-6/openjdk-6-jre-lib_6b17%7epre3-1_all.deb
2010-01-07 21:19:31+0100 [-] Unhandled Error
        Traceback (most recent call last):
          File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 1128, in run
            self.mainLoop()
          File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 1137, in mainLoop
            self.runUntilCurrent()
          File "/usr/lib/python2.5/site-packages/twisted/internet/base.py", line 757, in runUntilCurrent
            call.func(*call.args, **call.kw)
          File "/usr/lib/python2.5/site-packages/twisted/web2/stream.py", line 407, in _read
            self._gotData(result)
        ---  ---
          File "/usr/lib/python2.5/site-packages/twisted/web2/stream.py", line 421, in _gotData
            self.gotDataCallback(data)
          File "/usr/lib/pymodules/python2.5/apt_p2p/Streams.py", line 247, in _gotData
            raise StreamsError, "outFile was unexpectedly closed"
        apt_p2p.Streams.StreamsError: outFile was unexpectedly closed