Don't return spurious empty fields if 'keep_empty_values' is True.

Fixes SF bug #990307.
This commit is contained in:
Neil Schemenauer 2004-07-19 15:38:11 +00:00
parent 36a0f89c37
commit 66edb6295f
4 changed files with 38 additions and 2 deletions

View file

@ -209,6 +209,8 @@ def parse_qsl(qs, keep_blank_values=0, strict_parsing=0):
pairs = [s2 for s1 in qs.split('&') for s2 in s1.split(';')]
r = []
for name_value in pairs:
if not name_value and not strict_parsing:
continue
nv = name_value.split('=', 1)
if len(nv) != 2:
if strict_parsing: