#25730: base.Model __str__ sometimes returns unicode on Python 2
-------------------------------------+-------------------------------------
Reporter: keturn | Owner: nobody
Type: | Status: new
Cleanup/optimization |
Component: Database layer | Version: master
(models, ORM) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by keturn):
Returning the wrong type will gum things up even if the content of that
response is only ascii characters, as in
[https://code.djangoproject.com/ticket/25730#ticket this example].
Those format operations aren't always in places where you can change them
over to all use `__unicode__`, because they're embedded in things like
[https://github.com/python/cpython/blob/2.7/Lib/unittest/case.py#L691
TestCase messages], which is where I encountered it.
Having the test-failure message fail to format itself and crash is pretty
annoying when you're trying to write or fix a test.
--
Ticket URL: <https://code.djangoproject.com/ticket/25730#comment:4>
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/064.686d2daa6e13ed61035017850dbd811b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.