#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 claudep):

 I admit that due to an unfortunate missing standard in the past, URL
 encoded with non-utf-8 encodings are possible and correct RFC-wise.
 However, all modern browsers do encode the URLs with UTF-8, and that has
 nothing to do with "nicely displaying" them. They really send
 utf-8-encoded paths on the wire.

 If wsgiref/PEP 3333 chooses to continue to "wrongly" (but safely) decoding
 98% of URLs, it might be a design choice and it remains to be seen if it
 is a problem or not. Backwards compatibility is also an issue here.

 As far as Django is concerned, I do agree with your next steps. But I'm -1
 to using DEFAULT_CHARSET for decoding URLs. Django has absolutely no
 influence on the encoding of URL paths, that's the user agent's business.
 So even when you decide you want to serve non UTF-8 responses by setting
 DEFAULT_CHARSET, you still have no influence on the encoding of the paths
 you are receiving from clients (also taking into account hand-written URLs
 in browser address bars). In my opinion, these are orthogonal issues.

 I have unfortunately not the public-facing infrastructure to run a Python
 3 Django test instance, but it would be nice to have one such test project
 to see how it goes, and what various user agents are sending to the server
 with non-ascii URLs.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19468#comment:7>
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