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

Asyncio win32 issue? #15

Open
michelvw opened this issue Jan 13, 2021 · 0 comments
Open

Asyncio win32 issue? #15

michelvw opened this issue Jan 13, 2021 · 0 comments

Comments

@michelvw
Copy link
Contributor

I'm getting a not implementederror when running this. Issue seems windows related.

Traceback (most recent call last):
  File "C:\Program Files (x86)\Python38-32\lib\runpy.py", line 193, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\Program Files (x86)\Python38-32\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\Users\mvwe\AppData\Roaming\Python\Python38\site-packages\aiotuya\__main__.py", line 242, in <module>
    loop.remove_reader(sys.stdin)
  File "C:\Program Files (x86)\Python38-32\lib\asyncio\events.py", line 504, in remove_reader
    raise NotImplementedError
NotImplementedError

The default eventloop doesn't seem to work on win32. I think a fix should be:

if sys.platform == 'win32':
    loop = aio.ProactorEventLoop()
    aio.set_event_loop(loop)
else: 
    loop = aio.get_event_loop()

for line 226 in main.py. But now in run into the second issue. stdin does not seem to be supported.

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