This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: urllib.parse.quote_plus ignores optional arguments
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.0, Python 3.1, Python 3.2
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: georg.brandl, mgiuca
Priority: normal Keywords: patch

Created on 2009-05-26 16:15 by mgiuca, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
urllib_quote_plus.patch mgiuca, 2009-05-26 16:15 Patch for urllib.parse.py, fix + test cases.
Messages (2)
msg88368 - (view) Author: Matt Giuca (mgiuca) Date: 2009-05-26 16:15
urllib.parse.quote_plus will ignore its encoding and errors arguments if
its input string has a space in it.

Intended behaviour:
>>> urllib.parse.quote_plus("\xa2\xd8 \xff", encoding='latin-1')
'%A2%D8+%FF'
Observed behaviour:
>>> urllib.parse.quote_plus("\xa2\xd8 \xff", encoding='latin-1')
'%C2%A2%C3%98+%C3%BF'
(This just uses the default UTF-8 encoding).

Attached patch with test cases. This only affects Python 3.x (the 2.x
branch has no encoding/errors argument).
msg88378 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-05-26 18:31
Thanks, applied in r72943.
History
Date User Action Args
2022-04-11 14:56:49adminsetgithub: 50368
2009-05-26 18:31:31georg.brandlsetstatus: open -> closed

nosy: + georg.brandl
messages: + msg88378

resolution: accepted
2009-05-26 16:15:23mgiucacreate