Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Build URLs using urljoin #1217
This PR makes a small change to how URL's are created when a Host is specified. Previously, the URL was built by using string concatenation. This changes it to use
This fixes the edge case where a host is entered containing a trailing slash (i.e.
assert urljoin("telnet://127.0.0.1", "/") == '/'
assert "%s%s" % ("telnet://127.0.0.1", "/") == 'telnet://127.0.0.1/'
which changed the failure exception from requests.
This is because
Also, I'm suspicious that this is doing the wrong thing anyway, as if the base_url contains a path and does not end in a
I suspect this change will break examples/browse_docs_test.py, for example, due to how urljoin handles absolute paths on the second parameter.
It might be better to just use