[paramiko] Emulating scp

2009-12-03 Thread Marcin Krol
Sigh... It seems that scp on some platforms does indeed return smth different than binary 0, 1 or 2 as reply. In my case ssh in question was openssh-server-3.9p1-8.RHEL4.9 on x64 hardware, where scp returned empty string after 'scp -t -v' command even though scp continued operation normally

Re: [paramiko] alternate ciphers

2010-01-27 Thread Marcin Krol
Hello James, I'm sorry to say that it doesn't work: james bardin wrote: I don't there's any way to set the security options with SSHClient, so you will have to use the Transport directly. ### import paramiko import socket s = socket.socket() s.connect(('localhost', 22)) t =

[paramiko] unknown cipher

2010-02-03 Thread Marcin Krol
Hello everyone, I'm getting 'unknown cipher': Traceback (most recent call last): File /usr/local/lib/python2.6/threading.py, line 522, in __bootstrap_inner self.run() File /var/www/html/cssh4.py, line 946, in run self.ssh_connect_for_scp() File /var/www/html/cssh4.py, line 637,

Re: [paramiko] unknown cipher

2010-02-04 Thread Marcin Krol
james bardin wrote: On Wed, Feb 3, 2010 at 5:30 AM, Marcin Krol mrk...@gmail.com wrote: Hello everyone, I'm getting 'unknown cipher': Are you using the latest version of paramiko (1.7.6)? No. Silly me. I have upgraded to 1.7.6 and it works. Thanks, James! Performance-wise: time cssh.py

[paramiko] CPU usage while connecting

2010-02-05 Thread Marcin Krol
Hello everyone, I have one host that is extremely slow to respond (30 seconds or more). When I connect with paramiko.SSHClient() using username and password, the connection fails immediately for some reason. However, then I undertake 2nd connection attempt using a key. During that time

Re: [paramiko] CPU usage while connecting

2010-02-10 Thread Marcin Krol
Hello James, james bardin wrote: I would use threading.Timer, and have the callback try to close the transport. I think you need to put this around transport.start_client(). Here's the simplest possible example: ## s = socket.socket() s.connect(('localhost', 22)) t =

Re: [paramiko] CPU usage while connecting

2010-02-11 Thread Marcin Krol
I'm just shooting in the dark since I can't replicate this, but you could try to break the connection by closing the socket from underneath the transport (stored in transport.sock). Unfortunately, no: def printandclose(self): print \ntrying to close transport.sock

Re: [paramiko] CPU usage while connecting

2010-02-11 Thread Marcin Krol
james bardin wrote: trying to close transport.sock No handlers could be found for logger paramiko.transport ERROR (9, 'Bad file descriptor') Are you getting a stack trace here, or is paramiko eating the exception and just printing out the ERROR line? That's the case, that is, just the above

[paramiko] Problem with Solaris 5.9

2010-04-13 Thread Marcin Krol
Hello James, I swear it's real this time. :-) So I have this code: try: channel = transport.open_session() except Exception, e: return str(e) ..and I traced execution of the program in winpdb: 1. before channel = transport.open_session() I have

Re: [paramiko] Multithreading

2010-06-30 Thread Marcin Krol
Nikolaus Rath wrote: All I need is a Python API for uploading, downloading and renaming files over SSH. I chose SFTPClient since it seemed to be the simplest solution, and I don't remember seeing any warnings about performance or compatibility. I don't know about paramiko implementation of

Re: [paramiko] Multithreading

2010-07-01 Thread Marcin Krol
james bardin wrote: The main loop is a busy loop! It's hogging the GIL itself, and pegging a cpu core at %100. Because the threads only do work with a lock, there is no time for the GIL to switch threads., The sleep() simply allows a few cycles for the GIL to be released. Oops! I didn't

Re: [paramiko] Multithreading

2010-07-02 Thread Marcin Krol
Andrew Bennetts wrote: If you meant “can handle many concurrent connections” instead, I'd suggest Twisted, it tends to excel at that sort of task (and without threads, usually). Personally, even if threads are required I'd probably lean towards using it anyway :) Threads are not a hard