#19468: django doesn't encode request.path correctly in python3
---------------------------------+------------------------------------
     Reporter:  aliva            |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  Python 3         |                  Version:  master
     Severity:  Release blocker  |               Resolution:
     Keywords:                   |             Triage Stage:  Accepted
    Has patch:  1                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+------------------------------------

Comment (by aaugustin):

 May I suggest a different look at these percentages?

 Django is serving two populations of programmers here:
 - the 99.x% who either use utf-8 everywhere or don't even know what an
 encoding is. The debate is moot for them because they have
 `DEFAULT_CHARSET = 'utf-8'`. And anyone who expects non ASCII URLs typed
 in a browser bar to work falls in this category.
 - the 0.y% who want non-utf-8 URLs, for whatever reason. These are people
 who have special needs and who can be assumed to know what they're doing.
 They're probably not writing consumer websites. Their software may never
 be accessed by browsers.
   - Forcing utf-8 decoding states upfront that Django doesn't support this
 use case: it'll fail in 98% of the cases and return wrong results in the
 other 2%.
   - Trying utf-8 decoding, and falling back to `DEFAULT_CHARSET`, will
 work in 98% of the cases and return the wrong result in only 2% of the
 cases. This may be missed in testing and can't be relied upon in
 production. It's a trap and it's useless.

 If you're bent on only supporting utf-8 URLs, please be upfront about it
 and don't make it a trap.

 I'm getting weary of this debate; if I haven't convinced you, do what you
 want. For the record, I don't condone non-deterministic decoding, ie.
 "here's your decoded path — well, maybe, because if it happened to be
 valid utf-8 Django decoded it with utf-8 instead".

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19468#comment:11>
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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to