[issue42975] urllib.parse.parse_qsl(): add an option to not consider semicolon (; ) as separator

2021-01-20 Thread STINNER Victor


STINNER Victor  added the comment:

Oh, I mark my issue as a duplicate of bpo-42967.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Web cache poisoning - `;` as a query args separator

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42975] urllib.parse.parse_qsl(): add an option to not consider semicolon (; ) as separator

2021-01-20 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

See also https://bugs.python.org/issue42967

--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue42975] urllib.parse.parse_qsl(): add an option to not consider semicolon (; ) as separator

2021-01-20 Thread STINNER Victor


New submission from STINNER Victor :

urllib.parse.parse_qsl() uses "&" *and* ";" as separators:

>>> urllib.parse.parse_qsl("a=1=2=3")
[('a', '1'), ('b', '2'), ('c', '3')]
>>> urllib.parse.parse_qsl("a=1=2;c=3")
[('a', '1'), ('b', '2'), ('c', '3')]

But the W3C standards evolved and now suggest against considering semicolon 
(";") as a separator:

https://www.w3.org/TR/2014/REC-html5-20141028/forms.html#url-encoded-form-data

"This form data set encoding is in many ways an aberrant monstrosity, the 
result of many years of implementation accidents and compromises leading to a 
set of requirements necessary for interoperability, but in no way representing 
good design practices. In particular, readers are cautioned to pay close 
attention to the twisted details involving repeated (and in some cases nested) 
conversions between character encodings and byte sequences."

"To decode application/x-www-form-urlencoded payloads (...) Let strings be the 
result of strictly splitting the string payload on U+0026 AMPERSAND characters 
(&)."

Maybe we should even go further in Python 3.10 and only split at "&" by 
default, but let the caller to opt-in for ";" separator as well.

--
components: Library (Lib)
messages: 385327
nosy: vstinner
priority: normal
severity: normal
status: open
title: urllib.parse.parse_qsl(): add an option to not consider semicolon (;) as 
separator
versions: Python 3.10

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com