#26549: HttpResponse.__str__ is missing on Python 3
-------------------------------+--------------------
Reporter: coredumperror | Owner: nobody
Type: Bug | Status: new
Component: HTTP handling | Version: 1.9
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------
The HttpResponse class includes this block:
{{{
if six.PY3:
__bytes__ = serialize
else:
__str__ = serialize
}}}
Because `__str__` is not defined when `six.PY3` is True, calling
`str(response_object)` falls back to `__repr__` on Python 3. However,
`__str__` is defined on Python 2, and it returns the full HTTP message.
It seems like bad idea to have the output of the "convert to string"
action be different based on Python version, as it makes multi-version
code difficult to implement and debug.
--
Ticket URL: <https://code.djangoproject.com/ticket/26549>
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/056.48a599d4638be0cdcc607b6f61a4b7bb%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.