Pre-PEP thread: Pre-PEP Discussion: RFC 9457 Error Responses for Package registries
Current PEP text: PEP 847 – Problem Details for the Simple Repository API | peps.python.org
Summary of rationale and motivation
Right now, there is no standard way for package indices (i.e. services offering the Simple Repository API) to present useful error messages to users. As a result, package installers (pip, Poetry, uv) have generally converged on the lowest common denominator of rendering the HTTP status code along with its phrase.
This is suboptimal because it’s (1) generic, meaning that indices with different authentication and access patterns can’t present useful errors, and (2) becoming even more generic with the adoption of HTTP/2, since HTTP/2 no longer allows origins to customize the status phrase itself.
(Generic as in “supplies very little information,” not as in “general.” It’s the opposite of general too!)
Summary of proposed changes
This PEP proposes the adoption of RFC 9457-style “problem details” as a uniform error representation for the Simple Repository API. The main advantages of this approach are that it’s backwards compatible (both in terms of HTTP semantics and how existing installers behave), as well as progressively enhanceable (servers can insert as little or as much context as they find useful into a standard, structured error response format).
I recommend looking at Appendix 1 for some (purely hypothetical) examples of how problem details can be presented by servers and rendered by clients!
As always, I look forward to the community’s feedback on this proposal ![]()
CC @dstufft as sponsor/delegate
CC @zsol and @lgonzalez as co-authors