bdraco / aiodhcpwatcher

Watch for DHCP packets with asyncio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

unfortunately I still can't get the example to run

lejibxl opened this issue · comments

unfortunately I can't get your example to work

Python v 3.11.8
aiodhcpwatcher v 1.0.0

error

Traceback (most recent call last):
File "dsc_dhcp.py", line 14, in
asyncio.run(run())
File "C:\Python\Python311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Works\micado\lib\dsc_dhcp.py", line 11, in run
cancel = await aiodhcpwatcher.async_start(async_process_dhcp_request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Python\Python311\Lib\site-packages\aiodhcpwatcher_init
.py", line 211, in async_start
await watcher.async_start()
File "C:\Python\Python311\Lib\site-packages\aiodhcpwatcher_init
.py", line 144, in async_start
self._loop.add_reader(
File "C:\Python\Python311\Lib\asyncio\events.py", line 534, in add_reader
raise NotImplementedError
NotImplementedError

You need to change your event loop policy to selector on windows as protractor doesn't have add_reader


if sys.platform == 'win32':
  asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())

similar example
https://github.com/saghul/aiodns#note-for-windows-users