-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Double slashes when generating the inventory file URL #12782
Comments
PR welcome! A |
Ah yes, this one is on me. I don't remember why I did this. Maybe I incorrectly thought that the target_uri was stripped of its slash and wanted to reduce the imports. If this is the case, then I'm sorry. I'll do something for that this w-e or someone can fix it (it shouldn't be that hard). |
Would |
Technically, since we are dealing with URLs, we should have used >>> posixpath.join('https://a.com//', 'b')
'https://a.com//b' I'll prepare a PR. |
Websites probably shouldn't accept significant-multiple-separators in their paths, but I think that technically it's valid for them to do that. (serving different content at But |
(and then it's a question of whether we do that ourselves or via |
I revert it to the old behaviour in #12807. I don't want to mess with URLs and get complaints later :'). If we want to move from our current logic, more places need to be changed (there are some ifs where we test whether the URI is in some set of URIs where we explicitly add a forward slash, I don't remember where but I know it exists). |
Describe the bug
This might be considered an edge case but I've noticed that if the value tuple of a
intersphinx_mapping
contains a base URI with a trailing slash andNone
as the inventory file, Sphinx will try to load a URL with double slashes.How to Reproduce
Using Sphinx 8.0.2 set the following in the
conf.py
file of asphinx-quickstart
project:Run
make html
and notice the double slashes in the output message:The double slashes URL could be problematic depending on the web server setup.
Environment Information
Sphinx extensions
["sphinx.ext.intersphinx"]
Additional context
I think the problem could have been introduced in #12087 where:
sphinx/sphinx/ext/intersphinx/_load.py
Lines 185 to 186 in f90b506
was changed into:
sphinx/sphinx/ext/intersphinx/_load.py
Line 214 in fadb6b1
posixpath.join
removes the trailing slash in the target URI, but the f-string doesn't.The text was updated successfully, but these errors were encountered: