A relative path in a URL without netloc is preserved in urllib.parse.urlunsplit(). https://docs.python.org/3.12/whatsnew/changelog.html#id4