Why does Python urlparse.parse_qs () split arguments into semicolons

I am writing a test script in Python to check the output of my PHP application, and I had a problem with the Python function urlparse.parse_qs() . GET line separator (AFAIK) - ampersand. It is assumed that the function (as I understand it) splits the GET string into a Python dictionary, so the output for count=2&offset=5&userID=1 should be:

 {'count': ['2'], 'userID': ['1'], 'offset': ['5']} 

And so it is. But when I try to pass the CSV to a GET (separated by a semicolon) such as ids=5;15;3 , I get the following:

 [('3', ''), ('15', ''), ('ids', '5')] 

I think the actual output should look like this:

 {'ids': ['5;15;3']} 

What am I doing wrong? The line looks like this:

 args = urlparse.parse_qs(sys.argv[2], keep_blank_values=True) 
+6
python query-string get
source share

All Articles