Skip to content

Commit 98a2afe

Browse files
Prevent backslash stripping in parse_http_list
1 parent 8b669d5 commit 98a2afe

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Lib/test/test_urllib2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def test_parse_http_list(self):
7575
('a, b, "c", "d", "e,f", g, h',
7676
['a', 'b', '"c"', '"d"', '"e,f"', 'g', 'h']),
7777
('a="b\\"c", d="e\\,f", g="h\\\\i"',
78-
['a="b"c"', 'd="e,f"', 'g="h\\i"'])]
78+
['a="b\\"c"', 'd="e\\,f"', 'g="h\\\\i"'])]
7979
for string, list in tests:
8080
self.assertEqual(urllib.request.parse_http_list(string), list)
8181

Lib/urllib/request.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,6 @@ def parse_http_list(s):
14271427
if quote:
14281428
if cur == '\\':
14291429
escape = True
1430-
continue
14311430
elif cur == '"':
14321431
quote = False
14331432
part += cur

0 commit comments

Comments
 (0)