#19075: Query parameters are not decoded properly
---------------------------------+-------------------------------------
Reporter: ivan_virabyan | Owner: aaugustin
Type: Bug | Status: new
Component: HTTP handling | Version: master
Severity: Release blocker | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------------------
Comment (by claudep):
Replying to [comment:6 aaugustin]:
> This patch is fixing the problem at the wrong level — it's addressing
one symptom rather than the root cause.
Maybe, maybe not :-)
Here's what's happening with path and querystring in 1.4/Py2:
|| ||= path =||= querystring =||
||= 1.4 =|||| full path as a bytestring, separated on '?' as two
bytestrings in basehttp.py ||
|| || [basehttp.py] unquote(path) => utf-8 encoded bytestring ||
[basehttp.py] untouched ||
|| || [wsgi.py:WSGIRequest] force_unicode(path) => unicode path ||
http/__init__.py parse_qsl() => utf-8 encoded bytestring, then
force_unicode() on the result. ||
Currently in master/Python3, which seems to be correct:
|| ||= path =||= querystring =||
||= master/Py3 =|||| full path as a string, separated on '?' as two
*strings* in basehttp.py ||
|| || [basehttp.py] unquote(path) => unicode string || [basehttp.py]
untouched ||
|| || [wsgi.py:WSGIRequest] force_text(path), basically a noop ||
http/__init__.py parse_qsl() => unquote and decode qs to obtain unicode qs
||
Now the question remains about what to do in master/Py2, where currently
both path_info and query_string handling is broken.
One approach would be to let the Python 2 behaviour mostly untouched (the
str() or removing unicode_literals approach?), and the other would be to
mimic Python 3 (unicode everywhere) and trying to fix the stack to be able
to handle those inputs (what I tried, albeit incomplete).
--
Ticket URL: <https://code.djangoproject.com/ticket/19075#comment:8>
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 [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.