#28796: reverse() coerces bytes in args/kwargs to str which adds "b" prefixes to
the ouput
-----------------------------+--------------------------------------
     Reporter:  Nick         |                    Owner:  nobody
         Type:  Bug          |                   Status:  new
    Component:  Core (URLs)  |                  Version:  2.0
     Severity:  Normal       |               Resolution:
     Keywords:               |             Triage Stage:  Unreviewed
    Has patch:  0            |      Needs documentation:  0
  Needs tests:  0            |  Patch needs improvement:  0
Easy pickings:  0            |                    UI/UX:  0
-----------------------------+--------------------------------------

Comment (by Claude Paroz):

 I would say that `reverse` is not supposed to handle arbitrary
 bytestrings, so generally speaking, it's developer's role to decode any
 bytestring to a string (e.g. `force_text(b'caf\xe9')` will still produce a
 `DjangoUnicodeDecodeError`).

 Now I could understand that we privilege backwards compatibility and still
 accept ASCII bytesstrings by reintroducing `force_text` (at the expense of
 a slight overhead). It's some sort of design choice.

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

Reply via email to