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

Fix unclosed generator when running on trio #2587

Closed
wants to merge 2 commits into from

Conversation

florimondmanca
Copy link
Member

@florimondmanca florimondmanca commented Feb 13, 2023

While taking a look at resolving #2186, I came across an issue in the trio variant of test_asgi_streaming.

It seems that our usage of generators for __aiter__ doesn't satisfy trio's strict semantics.

AFAIU, when __aiter__() does more than delegating to an underlying async iterable, we should be implementing __anext__() so that aclosing() is applied to that streaming. Though my understanding is a bit limited so far in the night. 😃

This comes with a companion PR on httpcore. encode/httpcore#657

@tomchristie
Copy link
Member

It seems that our usage of generators for __aiter__ doesn't satisfy trio's strict semantics.

How does this present itself?
Can you demonstrate a warning that we're seeing with the existing implementation?

@tomchristie
Copy link
Member

I'm closing this off in line with encode/httpcore#657 for now. I'm open to the suggestion that there may be an issue here, but we'd need to be able to clearly demonstrate that first.

@tomchristie tomchristie closed this Jul 4, 2023
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.

2 participants