New submission from Joesph <someone...@gmail.com>: """ Per the documentation urlencode is supposed to encode a structure returned by parse_qs back to a query string. However, urlencode appears to not be processing the lists associated with each key. Example: """ import urllib.parse dictQuery = urllib.parse.parse_qs('a=b&b=c&c=d&c=e', strict_parsing=True, encoding='iso8859-1') assert isinstance(dictQuery,dict) assert isinstance(dictQuery['a'],list) strQuery = urllib.parse.urlencode(dictQuery, encoding='iso8859-1') print(strQuery) """ Outputs: a=%5B%27b%27%5D&c=%5B%27d%27%2C+%27e%27%5D&b=%5B%27c%27%5D Which means: a=['b']&c=['d', 'e']&b=['c'] Expected: a=b&c=d&c=e&b=c """
---------- components: Library (Lib) messages: 138850 nosy: someone3x7 priority: normal severity: normal status: open title: urllib.parse.urlencode encoding lists as strings type: behavior versions: Python 3.2 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12390> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com