This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jmg
Recipients jmg
Date 2020-01-19.06:43:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1579416220.77.0.52401810488.issue39386@roundup.psfhosted.org>
In-reply-to
Content
If I create a coro from an async iterator, then wait_for it w/ a timeout, but shielded, so it won't get canceled, and then await upon it, it returns invalid data.

See the attached test case.

The reason I do the following is to make sure that an async iterator that I have written doesn't return data early, and needs to wait till later.  If I didn't shield it, then the async iterator would get cancelled, and I don't want this.

I'd expect either correct results to be returned, or an exception to be raised, but in this case, and the docs for wait_for ( https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for ), I'd expect the correct results to be returned.


In the attached case, this is the results that I get:
$python3.7 asyncitertc.py 
3.7.5 (default, Oct 18 2019, 23:59:39) 
[Clang 7.0.2 (clang-700.1.81)]
timed out
yielding 1
results: None
getting 2: 2

I do not have python 3.8 to test with.
History
Date User Action Args
2020-01-19 06:43:40jmgsetrecipients: + jmg
2020-01-19 06:43:40jmgsetmessageid: <1579416220.77.0.52401810488.issue39386@roundup.psfhosted.org>
2020-01-19 06:43:40jmglinkissue39386 messages
2020-01-19 06:43:40jmgcreate