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

Httpx Response content is not set/read, causing JSON parsing errors #834

Open
Yun-Kim opened this issue Apr 11, 2024 · 0 comments
Open

Httpx Response content is not set/read, causing JSON parsing errors #834

Yun-Kim opened this issue Apr 11, 2024 · 0 comments

Comments

@Yun-Kim
Copy link

Yun-Kim commented Apr 11, 2024

Hi there, running into the same issue as #832. It seems like getting rid of the manual step to set response._content, as well as mocking the httpx.Response.read() function resulted in the following error by httpx (occurs non-deterministically in my CI):

httpx.ResponseNotRead: Attempted to access streaming response content, without having called `read()` 

I haven't narrowed down the non-deterministic nature of this bug, but it seems like there's two solutions to this:

  1. Re-insert the manual step to set response._content that was removed by Make httpx_stubs generate cassettes consistent with other stubs. #649
  2. Don't patch httpx.Response.read (not sure what the implications of this is)

This is causing a good amount of flakiness in my CI, so would really appreciate any insights/help getting this fixed. Thanks!

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

No branches or pull requests

1 participant