Skip to content
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

fix urljoin for arbitrary URL protocols #8020

Merged
merged 9 commits into from
Sep 17, 2023

Conversation

rmorshea
Copy link
Contributor

@rmorshea rmorshea commented May 26, 2023

This works around an issue with urllib.parse.urljoin where it only handles relative URLs for protocols contained in urllib.parse.uses_relative. As it happens common protocols used with git, like ssh or git+ssh are not in that list.

For more info: #6499 (comment)

Pull Request Check List

Resolves: #6499

  • Added tests for changed code.
  • Updated documentation for changed code.

@rmorshea rmorshea marked this pull request as ready for review May 26, 2023 19:44
@dimbleby
Copy link
Contributor

I can't tell what this fixes, a test case showing the point would be helpful

@rmorshea
Copy link
Contributor Author

@dimbleby, I'll add a test, but for now, the problem this solves is described here.

rmorshea and others added 4 commits May 30, 2023 15:03
This works around an issue with urllib.parse.urljoin where it only handles relative URLs for protocols contained in urllib.parse.uses_relative. As it happens common protocols used with git, like ssh or git+ssh are not in that list.
@rmorshea
Copy link
Contributor Author

rmorshea commented May 30, 2023

@dimbleby, I've added tests. Doing so required a bit of refactoring to make testing easier since actually cloning the test repo via SSH would require significant effort without a correspondingly large benefit. The core the of the change, as before, is urlpathjoin, which appropriately handles relative paths for URLs with ssh:// schemas.

@radoering radoering merged commit c014608 into python-poetry:master Sep 17, 2023
19 checks passed
Copy link

github-actions bot commented Mar 3, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Git dependencies' submodules with relative URLs handled incorrectly (regression from 1.1)
4 participants