278 | | if six.PY3: |
279 | | if isinstance(query_string, bytes): |
280 | | # query_string contains URL-encoded data, a subset of ASCII. |
281 | | query_string = query_string.decode() |
282 | | for key, value in parse_qsl(query_string or '', |
283 | | keep_blank_values=True, |
284 | | encoding=encoding): |
285 | | self.appendlist(key, value) |
286 | | else: |
287 | | for key, value in parse_qsl(query_string or '', |
288 | | keep_blank_values=True): |
289 | | self.appendlist(force_text(key, encoding, errors='replace'), |
290 | | force_text(value, encoding, errors='replace')) |
| 278 | if query_string: |
| 279 | if six.PY3: |
| 280 | if isinstance(query_string, bytes): |
| 281 | # query_string contains URL-encoded data, a subset of ASCII. |
| 282 | query_string = query_string.decode() |
| 283 | for key, value in parse_qsl(query_string, |
| 284 | keep_blank_values=True, |
| 285 | strict_parsing=True, |
| 286 | encoding=encoding, |
| 287 | errors='strict'): |
| 288 | self.appendlist(key, value) |
| 289 | else: |
| 290 | for key, value in parse_qsl(query_string, |
| 291 | keep_blank_values=True, |
| 292 | strict_parsing=True): |
| 293 | self.appendlist(force_text(key, encoding), |
| 294 | force_text(value, encoding)) |