Opened 18 years ago

Closed 18 years ago

#2924 closed defect (fixed)

Development server spins on an empty form post.

Reported by: Chris Beaven Owned by: Adrian Holovaty
Component: django-admin.py runserver Version:
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The relevant section from my template:

<form action="" method="post">
{% for followup in supplier.followups %}
<input type="checkbox" name="followups" value="{{ followup.id }}" /> {{ followup }}
{% endfor %}
</p>
<p><input type="submit" value="Remove selected logs" /></p>
</form>

If no checkboxes are selected, the servers sits there spinning after the submit button is pressed (which, note, has no name so isn't a POST item)

If I add <input type="hidden" name="empty" value="" /> inside the form, it works. So my conclusion is that the development server is spitting the dummy on an empty post.

When the next request comes in to the server, the console shows a traceback:

Traceback (most recent call last):
  File "D:\Web\Python24\lib\site-packages\django\core\servers\basehttp.py", line 273, in run
    self.finish_response()
  File "D:\Web\Python24\lib\site-packages\django\core\servers\basehttp.py", line 312, in finish_response
    self.write(data)
  File "D:\Web\Python24\lib\site-packages\django\core\servers\basehttp.py", line 391, in write
    self.send_headers()
  File "D:\Web\Python24\lib\site-packages\django\core\servers\basehttp.py", line 443, in send_headers
    self.send_preamble()
  File "D:\Web\Python24\lib\site-packages\django\core\servers\basehttp.py", line 372, in send_preamble
    self._write(
  File "D:\Web\Python24\Lib\socket.py", line 256, in write
    self.flush()
  File "D:\Web\Python24\Lib\socket.py", line 243, in flush
    self._sock.sendall(buffer)
error: (10053, 'Software caused connection abort')

Change History (3)

comment:1 by Adrian Holovaty, 18 years ago

Component: Core frameworkdjango-admin.py runserver

comment:2 by Adrian Holovaty, 18 years ago

Just ran into this myself. The problem is in django.core.handlers.wsgi, in WSGIRequest._get_raw_post_data(), in the safe_copyfileobj() call.

comment:3 by Adrian Holovaty, 18 years ago

Resolution: fixed
Status: newclosed

(In [4144]) Fixed #2924 -- Development server no longer spins on an empty form post. Bug caused by [3805]

Note: See TracTickets for help on using tickets.
Back to Top