gh-102247: Update HTTP status codes in http package to match rfc9110#102570
gh-102247: Update HTTP status codes in http package to match rfc9110#102570yeojin-dev wants to merge 8 commits intopython:mainfrom
Conversation
corona10
left a comment
There was a problem hiding this comment.
You have to notify the change to the whatsnews
Please refer to the similar commit.
corona10@a8e9348
| ``421`` ``MISDIRECTED_REQUEST`` HTTP/2 :rfc:`7540`, Section 9.1.2 | ||
| ``422`` ``UNPROCESSABLE_ENTITY`` WebDAV :rfc:`4918`, Section 11.2 | ||
| ``421`` ``MISDIRECTED_REQUEST`` HTTP Semantics :rfc:`9110`, Section 15.5.20 | ||
| ``422`` ``UNPROCESSABLE_CONTENT`` HTTP Semantics :rfc:`9110`, Section 15.5.21 |
There was a problem hiding this comment.
You have to notify the change with the versionchanged tag.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
@serhiy-storchaka |
| MISDIRECTED_REQUEST = (421, 'Misdirected Request', | ||
| 'Server is not able to produce a response') | ||
| UNPROCESSABLE_ENTITY = 422, 'Unprocessable Entity' | ||
| UNPROCESSABLE_CONTENT = 422, 'Unprocessable Content' |
There was a problem hiding this comment.
One of the problems of removing this constant is that it will break end-user code.
This is one example
https://github.com/aiven/karapace/blob/88bee3ab15115fca80b8f74020ebb30a3b562ffe/karapace/karapace.py#L41-L46
There was a problem hiding this comment.
Even if we decide to accept this change, we may need to add deprecation period rather than direct removing.
There was a problem hiding this comment.
I think we have to keep the old names as aliases for the new ones. I would continue to support them indefinitely, even -- deprecations and breaking things has a cost, and supporting a few extra constant names indefinitely is essentially free, so it's not worth spending our limited breakage budget on it.
| 'GONE', | ||
| 'LENGTH_REQUIRED', | ||
| 'PRECONDITION_FAILED', | ||
| 'REQUEST_ENTITY_TOO_LARGE', |
| 'EXPECTATION_FAILED', | ||
| 'IM_A_TEAPOT', | ||
| 'MISDIRECTED_REQUEST', | ||
| 'UNPROCESSABLE_ENTITY', |
Lib/test/test_httplib.py
Outdated
|
|
||
| def test_simple_httpstatus(self): | ||
| class CheckedHTTPStatus(enum.IntEnum): | ||
| @enum._simple_enum(enum.IntEnum) |
There was a problem hiding this comment.
I don't think that this change is the proper approach to fixing the test suite issue.
see
Lines 1896 to 1913 in 53dceb5
There was a problem hiding this comment.
I was wondering about the different use of enum in HTTPStatus and CheckedHTTPStatus, so I'm going to change it back.
|
It looks like Lines 1896 to 1913 in 53dceb5 |
corona10
left a comment
There was a problem hiding this comment.
Please revert #102570 (comment)
and wait @ethanfurman 's advice.
This reverts commit 90bf421.
References