The documenatation for urllib.parse (https://docs.python.org/3.0/library/urllib.parse.html) states several times:
"This may result in a slightly different, but equivalent URL, if the URL that was parsed originally had unnecessary delimiters (for example, a ? with an empty query; the RFC states that these are equivalent)."
This is false -- RFC 3986 explicitly states that ? with an empty query is _not_ equivalent to a URL without it. For example, the following two URL's should be considered different:
http://example.com/?
http://example.com/
https://tools.ietf.org/html/rfc3986#section-6.2.3 |