@@ -612,6 +612,7 @@ def unquote(string, encoding='utf-8', errors='replace'):
612
612
append (bits [i + 1 ])
613
613
return '' .join (res )
614
614
615
+
615
616
def parse_qs (qs , keep_blank_values = False , strict_parsing = False ,
616
617
encoding = 'utf-8' , errors = 'replace' ):
617
618
"""Parse a query given as a string argument.
@@ -633,6 +634,8 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
633
634
634
635
encoding and errors: specify how to decode percent-encoded sequences
635
636
into Unicode characters, as accepted by the bytes.decode() method.
637
+
638
+ Returns a dictionary.
636
639
"""
637
640
parsed_result = {}
638
641
pairs = parse_qsl (qs , keep_blank_values , strict_parsing ,
@@ -644,28 +647,29 @@ def parse_qs(qs, keep_blank_values=False, strict_parsing=False,
644
647
parsed_result [name ] = [value ]
645
648
return parsed_result
646
649
650
+
647
651
def parse_qsl (qs , keep_blank_values = False , strict_parsing = False ,
648
652
encoding = 'utf-8' , errors = 'replace' ):
649
653
"""Parse a query given as a string argument.
650
654
651
- Arguments:
655
+ Arguments:
652
656
653
- qs: percent-encoded query string to be parsed
657
+ qs: percent-encoded query string to be parsed
654
658
655
- keep_blank_values: flag indicating whether blank values in
656
- percent-encoded queries should be treated as blank strings. A
657
- true value indicates that blanks should be retained as blank
658
- strings. The default false value indicates that blank values
659
- are to be ignored and treated as if they were not included.
659
+ keep_blank_values: flag indicating whether blank values in
660
+ percent-encoded queries should be treated as blank strings.
661
+ A true value indicates that blanks should be retained as blank
662
+ strings. The default false value indicates that blank values
663
+ are to be ignored and treated as if they were not included.
660
664
661
- strict_parsing: flag indicating what to do with parsing errors. If
662
- false (the default), errors are silently ignored. If true,
663
- errors raise a ValueError exception.
665
+ strict_parsing: flag indicating what to do with parsing errors. If
666
+ false (the default), errors are silently ignored. If true,
667
+ errors raise a ValueError exception.
664
668
665
- encoding and errors: specify how to decode percent-encoded sequences
666
- into Unicode characters, as accepted by the bytes.decode() method.
669
+ encoding and errors: specify how to decode percent-encoded sequences
670
+ into Unicode characters, as accepted by the bytes.decode() method.
667
671
668
- Returns a list, as G-d intended.
672
+ Returns a list, as G-d intended.
669
673
"""
670
674
qs , _coerce_result = _coerce_args (qs )
671
675
pairs = [s2 for s1 in qs .split ('&' ) for s2 in s1 .split (';' )]
0 commit comments