Opened 10 years ago

Closed 10 years ago

#6647 closed (fixed)

WSGIRequestHandler dies on "OPTIONS *" request

Reported by: nospampleasethanks Owned by: nobody
Component: HTTP handling Version: master
Severity: Keywords: wsgi http server error
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


An exception is raised by the WSGIRequestHandler:

Exception happened during processing of request from ('', 60148)
Traceback (most recent call last):
  File "", line 222, in handle_request
    self.process_request(request, client_address)
  File "", line 241, in process_request
    self.finish_request(request, client_address)
  File "", line 254, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.5/site-packages/django/core/servers/", line 554, in __init__
    BaseHTTPRequestHandler.__init__(self, *args, **kwargs)
  File "", line 522, in __init__
  File "/usr/lib/python2.5/site-packages/django/core/servers/", line 595, in handle
    if not self.parse_request(): # An error code has been sent, just exit
  File "/usr/lib/python2.5/", line 279, in parse_request
    self.send_error(400, "Bad request syntax (%r)" % requestline)
  File "/usr/lib/python2.5/", line 343, in send_error
    self.log_error("code %d, message %s", code, message)
  File "/usr/lib/python2.5/", line 414, in log_error
  File "/usr/lib/python2.5/site-packages/django/core/servers/", line 603, in log_message
    if self.path.startswith(self.admin_media_prefix) or self.path == '/favicon.ico':
AttributeError: WSGIRequestHandler instance has no attribute 'path'

when an HTTP client makes the following request:


Django raises a 500 Internal Server Error. Should it return a 400 Bad Request instead?

A patch defining a dummy self.path is attached.

Attachments (1)

self_path_dummy.patch (764 bytes) - added by nospampleasethanks 10 years ago.
self.path dummy definition patch

Download all attachments as: .zip

Change History (4)

Changed 10 years ago by nospampleasethanks

Attachment: self_path_dummy.patch added

self.path dummy definition patch

comment:1 Changed 10 years ago by nospampleasethanks

Update: The line is "OPTIONS * HTTP/1.1" (thanks to Magus-, from #django fame).

comment:2 Changed 10 years ago by Simon Greenhill

Triage Stage: UnreviewedReady for checkin

comment:3 Changed 10 years ago by Malcolm Tredinnick

Resolution: fixed
Status: newclosed

(In [7801]) Fixed #6647 -- Add some more robustness to the development web server.

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