Django

Code

Ticket #2924 (closed: fixed)

Opened 2 years ago

Last modified 2 years ago

Development server spins on an empty form post.

Reported by: SmileyChris Assigned to: adrian
Milestone: Component: django-admin.py runserver
Version: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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')

Attachments

Change History

11/29/06 16:22:05 changed by adrian

  • component changed from Core framework to django-admin.py runserver.

11/29/06 16:34:26 changed by adrian

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

11/29/06 16:51:25 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #2924 (Development server spins on an empty form post.)




Change Properties
Action