[New-bugs-announce] [issue6118] urllib.parse.quote_plus ignores optional arguments

Matt Giuca report at bugs.python.org
Tue May 26 18:15:24 CEST 2009


New submission from Matt Giuca <matt.giuca at gmail.com>:

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).

----------
components: Library (Lib)
files: urllib_quote_plus.patch
keywords: patch
messages: 88368
nosy: mgiuca
severity: normal
status: open
title: urllib.parse.quote_plus ignores optional arguments
type: behavior
versions: Python 3.0, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14081/urllib_quote_plus.patch

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


More information about the New-bugs-announce mailing list