@@ -176,27 +176,26 @@ def parse_qs(qs, keep_blank_values=0, strict_parsing=0):
176176def parse_qsl (qs , keep_blank_values = 0 , strict_parsing = 0 ):
177177 """Parse a query given as a string argument.
178178
179- Arguments:
179+ Arguments:
180180
181- qs: URL-encoded query string to be parsed
181+ qs: URL-encoded query string to be parsed
182182
183- keep_blank_values: flag indicating whether blank values in
184- URL encoded queries should be treated as blank strings.
185- A true value indicates that blanks should be retained as
186- blank strings. The default false value indicates that
187- blank values are to be ignored and treated as if they were
188- not included.
183+ keep_blank_values: flag indicating whether blank values in
184+ URL encoded queries should be treated as blank strings. A
185+ true value indicates that blanks should be retained as blank
186+ strings. The default false value indicates that blank values
187+ are to be ignored and treated as if they were not included.
189188
190- strict_parsing: flag indicating what to do with parsing errors.
191- If false (the default), errors are silently ignored.
192- If true, errors raise a ValueError exception.
189+ strict_parsing: flag indicating what to do with parsing errors. If
190+ false (the default), errors are silently ignored. If true,
191+ errors raise a ValueError exception.
193192
194- Returns a list, as God intended.
193+ Returns a list, as G-d intended.
195194 """
196- name_value_pairs = string . splitfields ( qs , '&' )
197- r = []
198- for name_value in name_value_pairs :
199- nv = string . splitfields ( name_value , '=' , 1 )
195+ pairs = [ s2 for s1 in qs . split ( '&' ) for s2 in s1 . split ( ';' )]
196+ r = []
197+ for name_value in pairs :
198+ nv = name_value . split ( '=' , 1 )
200199 if len (nv ) != 2 :
201200 if strict_parsing :
202201 raise ValueError , "bad query field: %s" % `name_value`
0 commit comments