-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
--reload flag gives me an OSError on Windows #477
Comments
Thanks for filing this report. I'm wondering if there's an issue with the IOCP event loop here. |
One other issue that this throws up, is that we ought to be quiting when that error occurs, rather than continuing with application startup - it'd be worth us digging into that, too. |
Thanks for your answer. Unfortunately I get the same error with --loop asyncio: $ uvicorn example:app --reload --loop asyncio |
Thanks. It's obviously related to Python 3.8.0 switching to IOCP as the default async loop implementation. Related... tornadoweb/tornado#2608 For one thing I think we might want to start by adding uvicorn/uvicorn/supervisors/statreload.py Line 43 in f846a35
That's presumably fix things when We could then explicitly switch to asyncio being the default, perhaps. |
The error occurs each time I modify the file and save it. I tried adding the self.config.setup_event_loop() just after the line you mention but it does not solve the issue. |
Could you run it with Python 3.7 and |
Amazing it works with Python 3.7 and INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) Thank you for the workaround, I will stick to python 3.7 for now. However, unrelated but when I stop the server with CTRL+C I have this OSError: It does not happen without |
Should be closed via #487. Now released as 0.10.6. |
Thanks for bringing this up! |
Is it possible that this is not fixed? I still experience this issue on 0.10.8 with Python 3.7 as well as 3.6. (The asyncio work-around does work, though.) |
Hrm. That's interesting. Could you open a fresh issue to track this, so we've got a cleaner history on the issue (there's a few bits and pieces mashed together on this one.) I think we probably want to default to You'd be welcome to make a PR onto it as well if you fancy... Line 8 in ad4ea90
This is where we're auto-selecting which event loop to use. We probably just want to get rid of the |
Hi,
I'm trying a basic example with uvicorn : https://github.com/Celeborn2BeAlive/python_uvicorn_example
It's working but no the reload function: when I modify a file I get an OSError and the server seems to block when I refresh my page in my browser. After that I have to kill the server and start it again. Here is my complete output from uvicorn:
Here is some details about my system:
Note that I also tried with python 3.7.x and uvicorn 0.9.x and I had the same results.
Thanks for your work on uvicorn 👍
The text was updated successfully, but these errors were encountered: