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

Propagate URL errors in verbatim parsing #3720

Merged
merged 1 commit into from
May 21, 2024
Merged

Propagate URL errors in verbatim parsing #3720

merged 1 commit into from
May 21, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Closes #3715.

Test Plan

❯ echo "/../test" | cargo run pip compile -
error: Couldn't parse requirement in `-` at position 0
  Caused by: path could not be normalized: /../test
/../test
^^^^^^^^

❯ echo "-e /../test" | cargo run pip compile -
error: Invalid URL in `-`: `/../test`
  Caused by: path could not be normalized: /../test
  Caused by: cannot normalize a relative path beyond the base directory

@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label May 21, 2024
Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was more work than I expected!

@charliermarsh
Copy link
Member Author

Probably why I didn't do it in the first place >.< But it's the right thing. For some reason all the error threading in requirements-txt is sorta painful.

@charliermarsh charliermarsh enabled auto-merge (squash) May 21, 2024 19:54
@charliermarsh charliermarsh merged commit 558f628 into main May 21, 2024
45 checks passed
@charliermarsh charliermarsh deleted the charlie/rel branch May 21, 2024 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Panic with relative path beyond base directory
2 participants