Ticket #3922 (closed defect: fixed)
twisted.protocols.amp.BinaryBoxProtocol.connectionLost chokes on reason = main.CONNECTION_DONE
| Reported by: | dotz | Owned by: | exarkun |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Keywords: | win32 |
| Cc: | exarkun | Branch: | branches/stdio-connection-lost-reason-3922 |
| Author: | exarkun | Launchpad Bug: |
Description
I am running ActivePython 2.6 on Windows Vista with Twisted Trunk 19/07/2009 and ampoule trunk 19/07/2009 with patched https://bugs.launchpad.net/ampoule/+bug/401460
Trying to run ampoule-trunk/examples/pid.py example file shows, that amp.BinaryBoxProtocol chokes when reason is main.CONNECTION_DONE -- amp.py line 1992.
Why does it use reason.check(...) ? Where is that function documented, is it specified by any interface? As far as I know, 'reason' passed to connectionLost may be an ordinary Exception class, so I think there should be a check for that...
2009-07-19 21:01:28+0200 [-] FROM 0: Traceback (most recent call last): 2009-07-19 21:01:28+0200 [-] FROM 0: File "<string>", line 20, in <module> 2009-07-19 21:01:28+0200 [-] FROM 0: 2009-07-19 21:01:28+0200 [-] FROM 0: File "<string>", line 19, in main 2009-07-19 21:01:28+0200 [-] FROM 0: 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\base.py", line 1166, in run 2009-07-19 21:01:28+0200 [-] FROM 0: self.mainLoop() 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\base.py", line 1175, in mainLoop 2009-07-19 21:01:28+0200 [-] FROM 0: self.runUntilCurrent() 2009-07-19 21:01:28+0200 [-] FROM 0: --- <exception caught here> --- 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\base.py", line 779, in runUntilCurrent 2009-07-19 21:01:28+0200 [-] FROM 0: call.func(*call.args, **call.kw) 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\_pollingfile.py", line 72, in _pollEvent 2009-07-19 21:01:28+0200 [-] FROM 0: workUnits += resource.checkWork() 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\_pollingfile.py", line 129, in checkWork 2009-07-19 21:01:28+0200 [-] FROM 0: self.cleanup() 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\_pollingfile.py", line 134, in cleanup 2009-07-19 21:01:28+0200 [-] FROM 0: self.lostCallback() 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\_win32stdio.py", line 59, in readConnectionLost 2009-07-19 21:01:28+0200 [-] FROM 0: self.checkConnLost() 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\internet\_win32stdio.py", line 73, in checkConnLost 2009-07-19 21:01:28+0200 [-] FROM 0: self.proto.connectionLost(main.CONNECTION_DONE) 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\ampoule-0.1.1-py2.6.egg\ampoule\child.py", line 12, in connectionLost 2009-07-19 21:01:28+0200 [-] FROM 0: amp.AMP.connectionLost(self, reason) 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\protocols\amp.py", line 2229, in connectionLost 2009-07-19 21:01:28+0200 [-] FROM 0: BinaryBoxProtocol.connectionLost(self, reason) 2009-07-19 21:01:28+0200 [-] FROM 0: File "c:\python26\lib\site-packages\twisted-8.2.0-py2.6-win32.egg\twisted\protocols\amp.py", line 1992, in connectionLost 2009-07-19 21:01:28+0200 [-] FROM 0: elif reason.check(ConnectionClosed) and self._justStartedTLS: 2009-07-19 21:01:28+0200 [-] FROM 0: exceptions.AttributeError: 'ConnectionDone' object has no attribute 'check'
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

