Created
January 24, 2012 10:51
-
-
Save igniteflow/1669588 to your computer and use it in GitHub Desktop.
Fix for Django runserver: [Errno 32] Broken pipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| The problem is caused by the client terminating the call before the job is processed. To fix, add in the ThreadingMixIn as recommended here by Edward Samson (for a different, but related problem) here https://bitbucket.org/edu/woof/issue/1/errno-32-broken-pipe-upon-accessing-woof | |
| ---------------------------------------- | |
| Exception happened during processing of request from ('127.0.0.1', 41598) | |
| Traceback (most recent call last): | |
| File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock | |
| self.process_request(request, client_address) | |
| File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request | |
| self.finish_request(request, client_address) | |
| File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request | |
| self.RequestHandlerClass(request, client_address, self) | |
| File "/usr/lib/python2.7/SocketServer.py", line 641, in __init__ | |
| self.finish() | |
| File "/usr/lib/python2.7/SocketServer.py", line 694, in finish | |
| self.wfile.flush() | |
| File "/usr/lib/python2.7/socket.py", line 303, in flush | |
| self._sock.sendall(view[write_offset:write_offset+buffer_size]) | |
| error: [Errno 32] Broken pipe | |
| ---------------------------------------- | |
| Edit: /home/ptysoe/.virtualenvs/.../lib/python2.x/site-packages/django/core/servers/basehttp.py +562 | |
| """ | |
| # change | |
| class WSGIRequestHandler(BaseHTTPRequestHandler): | |
| # to | |
| from SocketServer import ThreadingMixIn | |
| class WSGIRequestHandler(BaseHTTPRequestHandler, ThreadingMixIn): |
Author
Doesn't work for Django 1.4.3.
Doesn't work for Django 1.3.5
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Valid for Django==1.2.3