[issue30483] urllib.parse.parse_qsl does not handle unicode data properly

2020-04-16 Thread Dmitry Tsirkov
Dmitry Tsirkov added the comment: I have recently stumbled upon this bug, and I can present the example and a solution I've used. The issue happens when we try to parse x-www-form-urlencoded of type bytes: ``` >>> from urllib.parse import urlencode, parse_qs >>> urlencode([('v', 'รถ')])

[issue30483] urllib.parse.parse_qsl does not handle unicode data properly

2018-05-29 Thread Cheryl Sabella
Cheryl Sabella added the comment: Would you be able to include an example for recreating this? Looking at the code, it uses the ascii encoding for bytes (which can only contain ASCII literal characters) and should not be using that encoding for strings. Thanks! -- nosy:

[issue30483] urllib.parse.parse_qsl does not handle unicode data properly

2017-05-26 Thread Abhilash Raj
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