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

Panic with relative path beyond base directory #3715

Closed
zanieb opened this issue May 21, 2024 · 0 comments · Fixed by #3720
Closed

Panic with relative path beyond base directory #3715

zanieb opened this issue May 21, 2024 · 0 comments · Fixed by #3720
Assignees
Labels
error messages Messaging when something goes wrong

Comments

@zanieb
Copy link
Member

zanieb commented May 21, 2024

❯ echo "/../test" | uv pip compile -
thread 'main' panicked at crates/pep508-rs/src/verbatim_url.rs:81:42:
path is absolute: Custom { kind: InvalidInput, error: "cannot normalize a relative path beyond the base directory" }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

We should throw a better error message here instead of panicking

@zanieb zanieb added the error messages Messaging when something goes wrong label May 21, 2024
@charliermarsh charliermarsh self-assigned this May 21, 2024
charliermarsh added a commit that referenced this issue May 21, 2024
## 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
```
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 a pull request may close this issue.

2 participants