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

Read data from file-like objects in requests (#719) #736

Merged
merged 4 commits into from
Sep 9, 2024

Conversation

mrob95
Copy link
Contributor

@mrob95 mrob95 commented Aug 31, 2024

Fixes #719

Currently I've only dealt with file-like objects and ignored any of the other types that urllib3 supports (see https://github.com/urllib3/urllib3/blob/abbfbcb1dd274fc54b4f0a7785fd04d59b634195/src/urllib3/util/request.py#L220). This seems like an easy improvement since the alternative is keeping file objects in the call list, which are likely to be closed by the time the user gets to them. I don't know whether responses should go further though and try to convert every possible request body into a single format (probably bytes) to make it easier for the user to assert on.

@markstory markstory self-assigned this Sep 5, 2024
@markstory
Copy link
Member

Looking good, but there are a few CI failures due to missing imports.

@mrob95
Copy link
Contributor Author

mrob95 commented Sep 6, 2024

Looking good, but there are a few CI failures due to missing imports.

Ah whoops, I think I have fixed the missing import and the line length lint failure now.

@markstory markstory merged commit fc457c7 into getsentry:master Sep 9, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot match request with data=filehandle
2 participants