bernii/querystring-parser

Erroneous building of variable length arrays

Gifts opened this issue · 4 comments

parsed = parser.parse('a[]=1&a[]=2')
print builder.build(parsed)

Expected: a[]=1&a[]=2
Result: a[][0]=1&a[][1]=2

Hmm tried your example and added it as a new unit test case (at the end of https://github.com/bernii/querystring-parser/blob/master/querystring_parser/tests.py). Seems to be returning an expected result (a[]=1&a[]=2).

Could you comment on that? I've also added CI via Travis and test are passing.

It's weird, test passes, but using interactive python shell returns me unexpected result. Maybe encoding issues?

Oops, my bad, was trying to build upon string object, not result of parser.parse. Closed

Thanks :)