[ python-Bugs-990307 ] cgi.parse_qsl broken

SourceForge.net noreply at sourceforge.net
Mon Jul 19 17:41:55 CEST 2004


Bugs item #990307, was opened at 2004-07-13 17:17
Message generated for change (Comment added) made by nascheme
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=990307&group_id=5470

Category: Python Library
Group: None
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Neil Schemenauer (nascheme)
>Assigned to: Neil Schemenauer (nascheme)
Summary: cgi.parse_qsl broken

Initial Comment:
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.


----------------------------------------------------------------------

>Comment By: Neil Schemenauer (nascheme)
Date: 2004-07-19 15:41

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=990307&group_id=5470


More information about the Python-bugs-list mailing list