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

feat(general): add support for windows 10 for aiohttp #6696

Merged
merged 7 commits into from
Sep 2, 2024

Conversation

AdamDev
Copy link
Contributor

@AdamDev AdamDev commented Sep 1, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Add support for windows 10 for aiohttp, it's throwing an error:
RuntimeError: aiodns needs a SelectorEventLoop on Windows.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes

@AdamDev AdamDev changed the title fix(windows): add support for windows 10 for aiohttp feat(windows): add support for windows 10 for aiohttp Sep 1, 2024
@AdamDev AdamDev changed the title feat(windows): add support for windows 10 for aiohttp feat(general): add support for windows 10 for aiohttp Sep 1, 2024
Comment on lines 367 to 371
@staticmethod
def set_config():
# asyncio - on windows aiodns needs SelectorEventLoop
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
Copy link
Contributor

Choose a reason for hiding this comment

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

@AdamDev How does it solve the issue?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This issue exists in many places in the network, this is the suggested solution:
aio-libs/aiodns#86 (comment)

Root cause:
aio-libs/aiodns#86 (comment)

@AdamDev AdamDev requested a review from Saarett September 1, 2024 10:48
@AdamDev AdamDev merged commit 2de9f6c into main Sep 2, 2024
41 checks passed
@AdamDev AdamDev deleted the fix_windows_aihttp_issue branch September 2, 2024 12:59
qdelettre pushed a commit to qdelettre/checkov that referenced this pull request Sep 2, 2024
)

* add support for windows 10 for aiohttp

* revert unrelevant changes

* revert unrelevant changes

* clean

* clean

---------

Co-authored-by: adam varsano <[email protected]>
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

Successfully merging this pull request may close these issues.

4 participants