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

Bug in flags2_asyncio.py (and flags3_asyncio.py) reporting #32

Open
jgc31 opened this issue Dec 20, 2022 · 0 comments
Open

Bug in flags2_asyncio.py (and flags3_asyncio.py) reporting #32

jgc31 opened this issue Dec 20, 2022 · 0 comments

Comments

@jgc31
Copy link

jgc31 commented Dec 20, 2022

First, let me thank you very much for this great book! Fluent Python is very pedagogical, informative and quite a pleasure to read.

So, I have been quite surprised to encounter a bug when running flags2_asyncio.py, in the error accounting in the supervisor function. After a first error happens, all downloads are counted as erroneous, even when they are in fact successful. This is because the "error" variable is never reset after entering the for loop.
This can be fixed simply by adding "else: error = None" at the end of the try/except (parallel to what you do in flags2_threadpool.py and flags2_asyncio_executor.py).

This bug is also present in flags3_asyncio.py.

(I am using Python3.10.)

A big thank you again!

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