#25730: base.Model __str__ sometimes returns unicode on Python 2
-------------------------------------+-------------------------------------
     Reporter:  keturn               |                    Owner:  charettes
         Type:                       |                   Status:  assigned
  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
-------------------------------------+-------------------------------------
Changes (by charettes):

 * status:  new => assigned
 * owner:  nobody => charettes


Comment:

 Didn't know about Python 2 behavior in this case.

 `b'%s' % u'foo'  # works`

 `b'%s' % u'bär' # works`

 `b'%s' % u'bär'.encode('utf-8') # works`

 `b'%s - %s' % (u'foo', u'bär'.encode('utf-8'))  # fails`

 It looks like this issue exists since we added Python 3 support in Django
 1.5

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

Reply via email to