I am using fabric python library using that I create the 50 times ssh connection I need it but I get following error [closed] - python

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
While using fabric library in python and forming ssh connection I am getting following error
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'
File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
File "/usr/local/lib/python2.7/dist-packages/paramiko/transport.py", line 1923, in run
<type 'exceptions.AttributeError'>: 'NoneType' object has no attribute 'error'

solve the issue by using connections in fabric python library .store all the ip in cache by default then at end of script disconnect from all remote machine by using disconnect_all() method.

Related

TypeError: runfile() got an unexpected keyword argument 'current_namespace' [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 1 year ago.
The community reviewed whether to reopen this question 2 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I got the error message when trying to debug a python script:
debugfile('C:/Users/Wei-shan/Desktop/pythonScripts/simple pendulum.py', wdir='C:/Users/Wei-shan/Desktop/pythonScripts', current_namespace=True)
Traceback (most recent call last):
File "C:\Users\Wei-shan\AppData\Local\Temp/ipykernel_19384/837447315.py", line 1, in <module>
debugfile('C:/Users/Wei-shan/Desktop/pythonScripts/simple pendulum.py', wdir='C:/Users/Wei-shan/Desktop/pythonScripts', current_namespace=True)
File "D:\anaconda3\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 589, in debugfile
enter_debugger(
File "D:\anaconda3\lib\site-packages\spyder_kernels\customize\spyderpdb.py", line 773, in enter_debugger
debugger.run(code)
File "D:\anaconda3\lib\site-packages\spyder_kernels\customize\spyderpdb.py", line 716, in run
super(SpyderPdb, self).run(cmd, globals, locals)
File "D:\anaconda3\lib\bdb.py", line 580, in run
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
TypeError: runfile() got an unexpected keyword argument 'current_namespace'
Any suggestions?
Thank you very much
This will be fixed in Spyder 5.1.2. In the meantime, downgrade the ipykernel package in the environment to 6.2.0:
conda activate my_env
conda install ipykernel=6.2.0
You should see something like:
The following packages will be DOWNGRADED:
ipykernel 6.4.1-py37h06a4308_1 --> 6.2.0-py37h06a4308_1
after which, restart spyder and it should be good.
For me, the error was fixed by completely uninstalling and reinstalling Spyder. It looks like the problem is that you have an outdated version of the spyder kernels. There was a change some time ago here. Maybe a simple
conda update --all
is enough. But i haven't tested this.

Ghost.py - what does this stack trace mean? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 8 years ago.
Improve this question
How do I go about debugging this stack trace?
Traceback (most recent call last):
File "<string>", line 73, in execInThread
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 196, in __call__
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\netref.py", line 71, in syncreq
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 431, in sync_request
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 379, in serve
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\protocol.py", line 337, in _recv
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\channel.py", line 50, in recv
File "C:\Program Files (x86)\PyScripter\Lib\rpyc.zip\rpyc\core\stream.py", line 166, in read
EOFError: [Errno 10054] An existing connection was forcibly closed by the remote host
The stack trace does not refer to a line in my code, which is too long to reproduce here. However, the key component other than the standard python library is Ghost.py.
Thanks!
This means the server closed the connection unexpectedly, usually because it crashed for some reason. In this case, it looks like the client is pyscripter and the server is a subprocess running your app, and it sounds like the subprocess crashed so hard that it did not gracefully close the connection or send back a meaningful traceback. So, either there is a bug in pyscripter or a bug in your code. My advice is to run your app without the IDE and see if you can reproduce the issue and get a meaningful traceback.

Audio/Video streaming fails using SimpleHTTPServer [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
Improve this question
I share files in a folder to other devices by invoking a server using python -m SimpleHTTPServer.
I just tried to stream videos/audio (standard mp4 & mp3, both under 20MB) to another computer using this & it WORKS (but by throwing the errors (listed down) in the terminal).
Somehow, the video/audio fails (except very small mp3 files) to play with Safari in iPhone/iPad. It is definitely not related to the media files, as I streamed them successfully using Apache in iPhone.
Any idea why it happens?
Exception happened during processing of request from ('192.168.1.2', 51775)
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 641, in __init__
self.finish()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/SocketServer.py", line 694, in finish
self.wfile.flush()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
As sugested either use python alternatives, What is a faster alternative to Python's http.server (or SimpleHTTPServer)? or use full blown web serwer altogether. Quick google suggests that Mac supports both Nignx and Apache2.

Multiprocessing: AttributeError: StdIn instance has no attribute 'close'

I get this error with multiprocessing when looping a simple range.
Process PoolWorker-37:
Traceback (most recent call last):
File "/usr/lib/python2.7/multiprocessing/process.py", line 249, in _bootstrap
sys.stdin.close()
AttributeError: StdIn instance has no attribute 'close'
The code
pool = multiprocessing.Pool(processes=3)
pool.map(get_info, range(20000,20010), 1)
pool.close()
pool.join()
Update
the first issue was by eclipse altering the environment, but now I get this error
PicklingError: Can't pickle <type 'cStringIO.StringO'>: attribute lookup cStringIO.StringO failed
This error is thrown if you are running in PyCharm console. I used the system console and all ran ok.
In PyCharm 4.5 the solution for me was to remove "Show command line afterwards" checkbox in server Run/Debug configuration for python file (which is not even documented in PyCharm manual)

Problem with the ipy.vim script

I'm trying to use the ipy.vim script to set up a small python dev environment, but I'm running into a connection problem. When I type ipy_vimserver.setup("demo") I get this error:
Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/pymodules/python2.6/IPython/Extensions/ipy_vimserver.py", line 109, in serve_me
self.listen()
File "/usr/lib/pymodules/python2.6/IPython/Extensions/ipy_vimserver.py", line 93, in listen
self.socket.bind(self.__sname)
File "<string>", line 1, in bind
error: [Errno 98] Address already in use
When I type it a second time, everything is fine but when I launch gvim the F4/F5 command do nothing and state that they can't connect to the Ipython server.
any suggestion?
Problem:
Look at the last line of the stack trace: error: [Errno 98] Address already in use
Explanation:
A nice explanation of "Address already in use" error can be found here: "Bind: Address Already in Use"
Possible Solution:
As I have not tried ipy.vim setup myself, from networking point of view, a quick suggestion would be to:
close/kill both the server (ipython server) and the client (vim running ipy.vim).
Restart ipython server
Run vim with ipy.vim and try to debug.
Additional Info:
On Linux/Unix machines, the timeout values are defined in /proc/sys/net/ipv4/tcp_keepalive_time and /proc/sys/net/ipv4/tcp_fin_time
On Windows machines, this is set in HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\TcpTimedWaitDelay. More details is here: TcpTimedWaitDelay
If I run the exact same code I get the same error. If I change the name from "demo" to, for example, "cookies" it works. Hmm....
This happens when there's already a socket with the name you're trying to create, in this case 'demo'. You need to delete it before doing the ipy_vimserver.setup - in your case, the socket file to delete is ~/.ipython/demo
(I'm one of the authors of ipy.vim)

Categories