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 OSError occurs when workers > 1 #1317 #1443

Closed
Closed
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions uvicorn/loops/asyncio.py
Expand Up @@ -6,6 +6,10 @@


def asyncio_setup(reload: bool = False) -> None: # pragma: no cover
if sys.version_info >= (3, 8) and sys.platform == "win32" and reload:
logger.warning("The --reload flag should not be used in production on Windows.")
if sys.version_info >= (3, 8) and sys.platform == "win32":
if reload:
logger.warning(
"The --reload flag should not be \
used in production on Windows."
Comment on lines +12 to +13
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"The --reload flag should not be \
used in production on Windows."
"The --reload flag should not be "
"used in production on Windows."

)
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())