urlparse() is similar to urlsplit(), but additionally it splits path on path and params using the ";" separator. This is wrong. First, the corresponding RFCs (RFC 3986, RFC 8820) do not list "params" as a separate URI component. Second, the ";" separator is used to specify parameters for a path segment, not the whole path. And this is scheme-specific, most schemes don't use it or use "," for similar purpose. It is mentioned in RFC 3986, but not in RFC 8820.
So, it is better to use urlsplit() and then parse path if needed. I afraid that most users of urlparse() are not aware of this, and only use it because it have more attractive name than urlsplit().
We should clearly document urlparse() as obsolete.
cc @orsenthil
Linked PRs
urlparse()is similar tourlsplit(), but additionally it splitspathonpathandparamsusing the ";" separator. This is wrong. First, the corresponding RFCs (RFC 3986, RFC 8820) do not list "params" as a separate URI component. Second, the ";" separator is used to specify parameters for a path segment, not the whole path. And this is scheme-specific, most schemes don't use it or use "," for similar purpose. It is mentioned in RFC 3986, but not in RFC 8820.So, it is better to use
urlsplit()and then parsepathif needed. I afraid that most users ofurlparse()are not aware of this, and only use it because it have more attractive name thanurlsplit().We should clearly document
urlparse()as obsolete.cc @orsenthil
Linked PRs