#25730: base.Model __str__ sometimes returns unicode on Python 2
----------------------------------------------+--------------------
     Reporter:  keturn                        |      Owner:  nobody
         Type:  Bug                           |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.8
     Severity:  Normal                        |   Keywords:
 Triage Stage:  Unreviewed                    |  Has patch:  0
Easy pickings:  1                             |      UI/UX:  0
----------------------------------------------+--------------------
 base.py contains `from __future__ import unicode_literals`

 so the thing that `Model.__str__` returns is a unicode object in the case
 where `hasattr(self, '__unicode__')` is False.

 There's a `force_text().encode()` on the other case; probably both cases
 should use `smart_str`.

 Discovered under Django 1.7 but this looks to still be the case in the
 master branch.

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

Reply via email to