#26546: Allow HTTPStatus enum values to be used as HttpResponse.status
--------------------------------------+--------------------
     Reporter:  evansd                |      Owner:  nobody
         Type:  Cleanup/optimization  |     Status:  new
    Component:  HTTP handling         |    Version:  master
     Severity:  Normal                |   Keywords:
 Triage Stage:  Unreviewed            |  Has patch:  0
Easy pickings:  0                     |      UI/UX:  0
--------------------------------------+--------------------
 Python 3.5 provides an
 [https://docs.python.org/3/library/http.html#http.HTTPStatus HTTPStatus]
 enum for representing HTTP statuses. The values of this enum are
 subclasses of `int`, so it ought to be possible to use them as the
 `status` argument to the `HttpResponse` constructor.

 However the `WSGIHandler` classes uses `%s` formatting rather than `%d`,
 which causes the values to be rendered as, e.g. `"HTTPStatus.OK"` rather
 than `"200"`.

 The associated patch (a single character change, excluding the tests)
 fixes this.

--
Ticket URL: <https://code.djangoproject.com/ticket/26546>
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/049.1c25e5592a0a192679131c46e4891f67%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to