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: cgi.parse_qsl broken
Type: Stage:
Components: Library (Lib) Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: nascheme Nosy List: nascheme
Priority: normal Keywords:

Created on 2004-07-13 17:17 by nascheme, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg21550 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2004-07-13 17:17
The cgi module has been changed so that now
parse_qsl("", keep_blank_values=True) returns [('',
'')].  I think that's wrong.  I thought about changing
it so that items with empty names are skipped but
test_cgi requires that "=a" produce [('', 'a')].  I
also thought about special casing the empty string to
return [] but test_cgi checks that parse_qsl("",
strict_parsing=1) raises ValueError.  That seems wrong
to me but I'm scared to change it since there may be
code out there that depends on this behavior.  OTOH, it
seems highly unlikely that people would find the strict
parsing flag useful (there's too much broken stuff on
the net).

The minimal fix would be to not generate any items that
are equal to ('', '').  Looking for advice.
msg21551 - (view) Author: Neil Schemenauer (nascheme) * (Python committer) Date: 2004-07-19 15:41
Logged In: YES 
user_id=35752

After discussing this with coworkers, I've decided on a fix.
 The effect of the change is that an empty key/value pair
will not be returned unless an '=' character appears in the
input.
History
Date User Action Args
2022-04-11 14:56:05adminsetgithub: 40551
2004-07-13 17:17:53naschemecreate