views:

373

answers:

2

I'm running the Django 1.2 development server and I get these Broken Pipe error messages whenever I load a page from it with Chrome or Safari. My co-worker is getting the error as well when he loads a page from his dev server. We don't have these errors when using Opera or Firefox.

Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 281, in run self.finish_response()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 321, in finish_response self.write(data)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/django/core/servers/basehttp.py", line 417, in write self._write(data)
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 300, in write self.flush()
File "/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.py", line 286, in flush self._sock.sendall(buffer)
error: [Errno 32] Broken pipe

Can anyone help me out? I'm going crazy over this!

+1  A: 

This is not a Django issue. Your browser is most likely doing something erroneous.

This is common error which happens whenever your browser closes the connection while the dev server is still busy sending data.

Check this Django ticket for more info.

Yuval A
A: 

I had a possibly related problem.

While using Safari and Chrome on Windows, on my local machine on my django runserver, some views were randomly not returning a response to ajax POST requests.

The solution was this:

The data I was passing in to the view via POST was just one key/val pair: "action=remove". Now, I wasn't actually using this data in my view. Once I assigned the data to a var in my view, (i.e. foo = request.POST['action']), the view would return a response to ajax requests every time.

Absolutely crazy!

Dave