-
Notifications
You must be signed in to change notification settings - Fork 141
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
AttributeError: 'MemoryObjectItemReceiver' object has no attribute 'item' #754
Comments
Would you be able to create a minimal workable example that demonstrates this issue? I'm not convinced that AnyIO is the real culprit here. |
This might be helpful @agronholm fastapi/fastapi#11652 ... I"m getting the same behaviour
|
There is one place in |
This was fixed by #767. Let me know if it wasn't. |
@agronholm tested using commit |
@agronholm Can we have a new release (4.4.1) with this bug fix? |
The next release will be v4.5.0 which is only pending my finalization of a fix for #695, and the review and merging of a number of outstanding PRs. |
I've got same issue (but from different place):
seems this line also should be fixed in the same way: try:
return receiver.item
except AttributeError:
raise EndOfStream |
Things to check first
I have searched the existing issues and didn't find my bug already reported there
I have checked that my bug is still present in the latest release
AnyIO version
4.4.0
Python version
3.11.9
What happened?
After bumping anyio from 4.3.0 to 4.4.0, one of our tests that depends on
starlette.testclient.TestClient
began to fail.Here is the ASGI lifespan code under test:
And here is the test itself:
Finally, here is the newly-encountered exception:
I added some
print
statements aroundanyio/from_thread.py
to see what is failing internally:How can we reproduce the bug?
Create a starlette/fastapi application with a test or otherwise that uses
starlette.testclient.TestClient
; in the ASGI lifespan async context manager, create/yield/cancel a task like so:Pin anyio to 4.3.0. The test should pass.
Bump anyio to 4.4.0. The test should now error.
The text was updated successfully, but these errors were encountered: