J
Jack
Hello
one problem, thanks for help
My script like this:
/hostname = xxx//
//username = xxx//
//password = xxx//
//t = paramiko.Transport((hostname, 22))//
//t.connect(username=username, password=password)//# here will be blocked
//sftp = paramiko.SFTPClient.from_transport(t)/
I used gdb attach the python process, found that:
/(gdb) py-bt
#2 <built-in function sleep>
#4 file '/usr/lib64/python2.6/threading.py', in 'wait'
#8 file '/usr/lib64/python2.6/threading.py', in 'wait'
#12 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/auth_handler.py',
in 'wait_for_response'
#15 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
in 'auth_password'
#19 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
in 'connect'
#23 file 'plugins.py', in '<module>'
#35 file '<stdin>', in '<module>'
(gdb) info threads
2 Thread 0x7fe956708700 (LWP 25635) 0x0000003806e0d720 in sem_wait ()
from /lib64/libpthread.so.0
* 1 Thread 0x7fe96163b700 (LWP 25615) 0x00000038066e0d03 in select ()
from /lib64/libc.so.6
(gdb) thread 2
[Switching to thread 2 (Thread 0x7fe956708700 (LWP 25635))]#0
0x0000003806e0d720 in sem_wait () from /lib64/libpthread.so.0
(gdb) py-bt
#1 Waiting for a lock (e.g. GIL)
#7 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/packet.py',
in 'compute_hmac'
#10 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/packet.py',
in 'read_message'
#13 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
in 'run'
#16 file '/usr/lib64/python2.6/threading.py', in '__bootstrap_inner'
#19 file '/usr/lib64/python2.6/threading.py', in '__bootstrap'
/
*but it is strange that when I use python interactive shell, the code
works well*
Regards,
Jack
one problem, thanks for help
My script like this:
/hostname = xxx//
//username = xxx//
//password = xxx//
//t = paramiko.Transport((hostname, 22))//
//t.connect(username=username, password=password)//# here will be blocked
//sftp = paramiko.SFTPClient.from_transport(t)/
I used gdb attach the python process, found that:
/(gdb) py-bt
#2 <built-in function sleep>
#4 file '/usr/lib64/python2.6/threading.py', in 'wait'
#8 file '/usr/lib64/python2.6/threading.py', in 'wait'
#12 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/auth_handler.py',
in 'wait_for_response'
#15 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
in 'auth_password'
#19 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
in 'connect'
#23 file 'plugins.py', in '<module>'
#35 file '<stdin>', in '<module>'
(gdb) info threads
2 Thread 0x7fe956708700 (LWP 25635) 0x0000003806e0d720 in sem_wait ()
from /lib64/libpthread.so.0
* 1 Thread 0x7fe96163b700 (LWP 25615) 0x00000038066e0d03 in select ()
from /lib64/libc.so.6
(gdb) thread 2
[Switching to thread 2 (Thread 0x7fe956708700 (LWP 25635))]#0
0x0000003806e0d720 in sem_wait () from /lib64/libpthread.so.0
(gdb) py-bt
#1 Waiting for a lock (e.g. GIL)
#7 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/packet.py',
in 'compute_hmac'
#10 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/packet.py',
in 'read_message'
#13 file
'/usr/lib/python2.6/site-packages/paramiko-1.9.0-py2.6.egg/paramiko/transport.py',
in 'run'
#16 file '/usr/lib64/python2.6/threading.py', in '__bootstrap_inner'
#19 file '/usr/lib64/python2.6/threading.py', in '__bootstrap'
/
*but it is strange that when I use python interactive shell, the code
works well*
Regards,
Jack