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

Ensure the reason is never an empty string, but None in HTTP responses #1063

Merged
merged 1 commit into from
Oct 8, 2023

Conversation

nolar
Copy link
Owner

@nolar nolar commented Oct 8, 2023

Otherwise, aiohttp (in tests) cannot parse the response with the trailing space in the status — "HTTP/1.1 555 " — since "555 ".split() returns only one element, and the whole string "555 " is used as the status with expectations of being a 3-digit numeric.

For some reason, the tests fail with this only in PyPy (all versions).

Otherwise, `aiohttp` (in tests) cannot parse the response with the trailing space in the status — `"HTTP/1.1 555 "` — since `"555 ".split()` returns only one element, and the whole string `"555 "` is used as the status with expectations of being a 3-digit numeric.

For some reason, the tests fail with this only in PyPy (all versions).

Signed-off-by: Sergey Vasilyev <nolar@nolar.info>
@nolar nolar changed the title Always add a reason to erroneous HTTP responses Ensure the reason is never an empty string, but None in HTTP responses Oct 8, 2023
@nolar nolar enabled auto-merge October 8, 2023 22:44
@nolar nolar merged commit 8cac6fb into main Oct 8, 2023
29 checks passed
@nolar nolar deleted the fix-http-tests branch October 8, 2023 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant