mirror of https://github.com/astral-sh/uv
Fixes #16340 ## Summary Some package registries (PyTorch, corporate PyPI mirrors) return `403 Forbidden` when a package is not found, instead of `404 Not Found`. The previous error message incorrectly suggested this was always an authentication issue, causing confusion for users. This PR updates the error hint to clarify that a 403 error could indicate either missing authentication credentials OR that the package doesn't exist on the index. ## Test Plan - Updated existing snapshot test in `crates/uv/tests/it/edit.rs` to reflect the new error message - The change is purely a message improvement with no behavioral changes ## Changes ### Before hint: An index URL (https://example.com/simple) could not be queried due to a lack of valid authentication credentials (403 Forbidden). ### After hint: An index URL (https://example.com/simple) returned a 403 Forbidden error. This could indicate missing authentication credentials, or the package may not exist on this index. ## Files Changed - `crates/uv-resolver/src/pubgrub/report.rs` - Updated error message - `crates/uv/tests/it/edit.rs` - Updated snapshot test expectation --------- Co-authored-by: eun2ce <eun2ce@eun2ceui-MacBookPro.local> Co-authored-by: konstin <konstin@mailbox.org> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||