#24868: Invalid kwarg passed to technical_500_response() handling
SuspiciousOperation in debug mode
-------------------------+-------------------------------------------------
     Reporter:           |      Owner:  nobody
  andrewhayes1979        |
         Type:  Bug      |     Status:  new
    Component:  Core     |    Version:  1.8
  (URLs)                 |   Keywords:  technical_500_response
     Severity:  Normal   |  suspiciousoperation
 Triage Stage:           |  Has patch:  0
  Unreviewed             |
Easy pickings:  1        |      UI/UX:  0
-------------------------+-------------------------------------------------
 Version: 1.8.2
 File: django/core/handlers/base.py
 Line: 206

 ...if in debug mode, and a suspicious operation is raised, the following
 code gets executed:

 {{{
             if settings.DEBUG:
                 return debug.technical_500_response(request,
 *sys.exc_info(), status_code=400)
 }}}

 ...this causes the technical_500_response() function to throw a further
 exception because it's not expecting a "status_code" keyword argument.

 Though I appreciate that SuspiciousOperation shouldn't really be thrown by
 user code (only by Django in production in relation to ALLOWED_HOSTS
 issues -- the code that uncovered this has since been modified), the error
 still needs addressing, whether in the code above, or amending in
 technical_debug_response() to accept status_code as a keyword argument.

--
Ticket URL: <https://code.djangoproject.com/ticket/24868>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/058.9ad86e616dd664a4d48ada80c0f0f862%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to