“RuntimeError: generator raised StopIteration” every time I try to run app

To judge from the file paths, it looks like you’re running Python 3.7. If so, you’re getting caught by new-in-3.7 behavior: PEP 479 is enabled for all code in Python 3.7, meaning that StopIteration exceptions raised directly or indirectly in coroutines and generators are transformed into RuntimeError exceptions. (Contributed by Yury Selivanov in bpo-32670.) Before … Read more

Python 3.7 – asyncio.sleep() and time.sleep()

You aren’t seeing anything special because there’s nothing much asynchronous work in your code. However, the main difference is that time.sleep(5) is blocking, and asyncio.sleep(5) is non-blocking. When time.sleep(5) is called, it will block the entire execution of the script and it will be put on hold, just frozen, doing nothing. But when you call … Read more