-
Notifications
You must be signed in to change notification settings - Fork 275
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
os.path.join() used with URLs in Updater #1077
Comments
I think we actually have multiple os separator bugs in updater that end up somewhat compensating for each other...
I'm pretty sure it will be impossible to fix all of these in a way that wouldn't break some client mirror configuration where Windows separators were used in an innovative way... but probably it's still worth doing: If config like that exists it is just waiting to be broken I no longer agree with "good first issue" label :) (well, some items on the list may be easy, some are tricky) |
I think the reference implementation should adopt the same strategy when dealing with URLs/paths on the client side as well as on the repository side. And while the specification at least recommends the format of paths in the metadata:
mirrors.py is a fully implementation product ... So as I see @lukpueh already suggested in #1018, lets align these two ideas with both client and repository:
Maybe we can restrict updater to work only with path-relative-scheme-less-URL strings and add a convenience interface to form the full path URL and/or solve Windows-specific corner cases in the config? |
I'm going to close this:
|
mirrors.py does this:
This seems like an incorrect use of
os.path.join()
. I'm not sure what it does on Windows but there's probably room for bugs here.urllib.parse.join()
is probably the safe choice (although it has some annoying corner cases that makes it different fromos.path.join()
) ?There is a related issue here: I'm trying to figure out how to handle the case where metadata and targets are hosted on different hosts and the use of
os.path.join()
affects it. The discussion is in https://python.zulipchat.com/#narrow/stream/223926-pep458-implementation/topic/separate.20hosting.20for.20metadata.20and.20targets . Fixing this probably makes sense after we know the resolution of that discussion.The text was updated successfully, but these errors were encountered: