Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: [Errno 10053]

Tags:

If I am coding on Flask, then I sometimes get this error:

Traceback (most recent call last):   File "C:\Python27\lib\SocketServer.py", line 284, in _handle_request_noblock     self.process_request(request, client_address)   File "C:\Python27\lib\SocketServer.py", line 310, in process_request     self.finish_request(request, client_address)   File "C:\Python27\lib\SocketServer.py", line 323, in finish_request     self.RequestHandlerClass(request, client_address, self)   File "C:\Python27\lib\SocketServer.py", line 640, in __init__     self.finish()   File "C:\Python27\lib\SocketServer.py", line 693, in finish     self.wfile.flush()   File "C:\Python27\lib\socket.py", line 303, in flush     self._sock.sendall(view[write_offset:write_offset+buffer_size]) error: [Errno 10053] ��������� �� ����� ����- 

Any ideas why this would happen (win8 x64, python27 x32)?

like image 464
Patrick Burns Avatar asked Jul 25 '13 09:07

Patrick Burns


2 Answers

From the Windows Sockets Error Codes list:

WSAECONNABORTED 10053
Software caused connection abort.
An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error.

There was a timeout or other network-level error. This is your operating system closing the socket, nothing to do with Python or Flask, really.

It could be the remote browser stopped responding, the network connection died, or a firewall closed the connection because it was open too long, or any other number of reasons.

like image 59
Martijn Pieters Avatar answered Oct 13 '22 00:10

Martijn Pieters


Hello, This is an issue with the Python 2 implementation of the SocketServer module, it is not present in Python 3 (where the server keeps on serving).

Your have 3 options:

Don't use the built-in server for production systems (it is a development server after all). Use a proper WSGI server like gunicorn or uWSGI.

Enable threaded mode with app.run(threaded=True); the thread dies but a new one is created for future requests,

Upgrade to Python 3.

So whenever there is error like

error: [Errno 10053] An established connection was aborted by the software in your host machine 

Server would be restarted if you have done like app.run(threaded=True).

like image 34
Keyur Avatar answered Oct 13 '22 00:10

Keyur