[New-bugs-announce] [issue30483] urllib.parse.parse_qsl does not handle unicode data properly

Abhilash Raj report at bugs.python.org
Fri May 26 05:49:46 EDT 2017


New submission from Abhilash Raj:

After decoding percentage encoded `name` and `values` in the query string, it tries to `_coerce_result` or encode the result to ascii (which is the value of _implicit_encoding).

```
  File "/usr/lib/python3.6/urllib/parse.py", line 691, in parse_qsl
    value = _coerce_result(value)
  File "/usr/lib/python3.6/urllib/parse.py", line 95, in _encode_result
    return obj.encode(encoding, errors)
UnicodeEncodeError: 'ascii' codec can't encode character '\xe9' in position 1: ordinal not in range(128)
```

As seen in the partial traceback above, it breaks things when trying to parse unicode encode query string values.

----------
messages: 294541
nosy: maxking
priority: normal
severity: normal
status: open
title: urllib.parse.parse_qsl does not handle unicode data properly
versions: Python 3.5, Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30483>
_______________________________________


More information about the New-bugs-announce mailing list