[Twisted-Python] implementing scp using Conch

Jean-Paul Calderone exarkun at divmod.com
Wed Nov 30 19:00:07 EST 2005

On Wed, 30 Nov 2005 21:07:08 +0000, erick_bodine at comcast.net wrote:
>Using a suggestion from David Mertz's old article I am implementing scp using Conch.  I can scp from the server to the client, it does give an exception listed below.  Question #1 is why is the exception happening?  Question #2 is how to scp from the client to the server?  Can I use sendRequest() to open a file and then Channel.write('some data') to send the client file contents?
>Traceback (most recent call last):
>  File "client_mertz.py", line 80, in ?
>    reactor.run()
>  File "/usr/lib/python2.3/site-packages/twisted/internet/posixbase.py", line 206, in run
>    self.mainLoop()
>  File "/usr/lib/python2.3/site-packages/twisted/internet/posixbase.py", line 214, in mainLoop
>    self.runUntilCurrent()
>--- <exception caught here> ---
>  File "/usr/lib/python2.3/site-packages/twisted/internet/base.py", line 541, in runUntilCurrent
>    call.func(*call.args, **call.kw)
>  File "/usr/lib/python2.3/site-packages/twisted/internet/base.py", line 397, in _continueSystemEvent
>    for callList in sysEvtTriggers[1], sysEvtTriggers[2]:
>exceptions.TypeError: unsubscriptable object

This happens most frequently as a result of calling reactor.stop() more than once.

It'd be nice if the 2nd (and subsequent) calls to reactor.stop() raised exceptions synchronously, probably.  It doesn't seem to be a very high priority change, though.


More information about the Twisted-Python mailing list