Bugs item #735248, was opened at 2003-05-09 16:09 Message generated for change (Comment added) made by birkenfeld You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=735248&group_id=5470
Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Python Library Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Jim Jewett (jimjjewett) >Assigned to: Reinhold Birkenfeld (birkenfeld) Summary: urllib2 parse_http_list wrong return Initial Comment: parse_http_list should split a string on commas, unless the commas are within a quoted-string. (It allows only the "" quote, and not the single-quote, but this seems to follow the RFC.) If there are not quoted-strings, it repeats the first tokens as part of subsequent tokens. parse_http_list ('a,b') => ['a','a,b'] It should return ['a','b'] parse_http_list ('a,b,c') => ['a','a,b','a,b,c'] It should return ['a','b','c'] Patch: On (cvs version) line 882, when no quote is found and inquote is false, reset the start position to after the comma. if q == -1: if inquote: raise ValueError, "unbalanced quotes" else: list.append(s[start:i+c]) i = i + c + 1 start = i #New line continue ---------------------------------------------------------------------- >Comment By: Reinhold Birkenfeld (birkenfeld) Date: 2005-08-25 00:21 Message: Logged In: YES user_id=1188172 Fixed the algorithm in Lib/urllib2.py r1.86, 1.77.2.3 Added testcase in Lib/test/test_urllib2.py r1.22, 1.19.2.1 ---------------------------------------------------------------------- Comment By: John J Lee (jjlee) Date: 2003-11-10 00:53 Message: Logged In: YES user_id=261020 This function doesn't deal with quoting of characters inside quoted-strings, either. In particular, it doesn't deal with \", \, and \, (see RFC 2616, section 2.2, quoted-pair). ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=735248&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com