#28679: urlencode does not decode bytes before passing them to Python's
urlencode
-------------------------------------+-------------------------------------
Reporter: François | Owner: nobody
Freitag |
Type: | Status: new
Uncategorized |
Component: Utilities | Version: 2.0
Severity: Normal | Keywords: urlencode bytes
Triage Stage: | Has patch: 1
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
{{{urlencode}}} should decode bytes objects before to pass them to
python's urlencode. Instead, it's currently calling str on the bytes,
passing the {{{bytes.__str__}}} representation of the bytes (b'...') to
urlencode.
{{{#!python
# A dictionary with bytes value
result = http.urlencode({'a': b'abc'}, doseq=True)
self.assertEqual(result, 'a=abc')
# Test result on 2.0a1
AssertionError: 'a=b%27abc%27' != 'a=abc'
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28679>
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/058.dff0fd0070c08e46861d8fb992230542%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.