When attempting to run Virtual Lightning (vl) on Ubuntu 22.4 with Python 3.10.6 and vl 2.3.0, users encounter a traceback error. The error originates from the virEventRegisterAsyncIOImpl function in the libvirtaio.py file, leading to a TypeError due to the removal of the loop parameter from the asyncio.Event() constructor starting from Python 3.10.
Steps to Reproduce:
1.
Install Ubuntu 22.4 and Python 3.10.6 on the system.
2.
Install Virtual Lightning (vl) version 2.3.0 using the command: pip install vl==2.3.0.
3.
Execute any vl command, such as vl up.
Expected Behavior:
Virtual Lightning (vl) should run without any errors and perform the intended actions without issues.
Actual Behavior:
Upon running any vl command, the following traceback error is encountered:
Traceback (most recent call last):
File "/home/ali/.local/bin/vl", line 8, in
sys.exit(main())
File "/home/ali/.local/lib/python3.10/site-packages/virt_lightning/shell.py", line 382, in main
action_func(configuration=configuration, *vars(args))
File "/home/ali/.local/lib/python3.10/site-packages/virt_lightning/api.py", line 180, in up
_register_aio_virt_impl(loop)
File "/home/ali/.local/lib/python3.10/site-packages/virt_lightning/api.py", line 67, in _register_aio_virt_impl
libvirtaio.virEventRegisterAsyncIOImpl(loop=loop)
File "/usr/lib/python3/dist-packages/libvirtaio.py", line 477, in virEventRegisterAsyncIOImpl
_current_impl = virEventAsyncIOImpl(loop=loop).register()
File "/usr/lib/python3/dist-packages/libvirtaio.py", line 285, in init
self._finished = asyncio.Event(loop=loop)
File "/usr/lib/python3.10/asyncio/locks.py", line 168, in init
super().init(loop=loop)
File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in init
raise TypeError(
TypeError: As of 3.10, the loop* parameter was removed from Event() since it is no longer necessary
Proposed Solution:
To resolve the issue, the Virtual Lightning (vl) codebase should be updated to accommodate the changes made to the asyncio.Event() constructor in Python 3.10. The usage of the loop parameter should be removed from the libvirtaio.py file, and the code should be modified to work seamlessly with Python 3.10 and later versions.
Workaround:
As a temporary workaround, users can consider downgrading their Python version to one that is compatible with Virtual Lightning (vl) until an updated version of vl is released to address the issue. Alternatively, they can use Python 3.9.x or any version that still supports the loop parameter in the asyncio.Event() constructor.
When attempting to run Virtual Lightning (vl) on Ubuntu 22.4 with Python 3.10.6 and vl 2.3.0, users encounter a traceback error. The error originates from the
sys.exit(main())
File "/home/ali/.local/lib/python3.10/site-packages/virt_lightning/shell.py", line 382, in main
action_func(configuration=configuration, *vars(args))
File "/home/ali/.local/lib/python3.10/site-packages/virt_lightning/api.py", line 180, in up
_register_aio_virt_impl(loop)
File "/home/ali/.local/lib/python3.10/site-packages/virt_lightning/api.py", line 67, in _register_aio_virt_impl
libvirtaio.virEventRegisterAsyncIOImpl(loop=loop)
File "/usr/lib/python3/dist-packages/libvirtaio.py", line 477, in virEventRegisterAsyncIOImpl
_current_impl = virEventAsyncIOImpl(loop=loop).register()
File "/usr/lib/python3/dist-packages/libvirtaio.py", line 285, in init
self._finished = asyncio.Event(loop=loop)
File "/usr/lib/python3.10/asyncio/locks.py", line 168, in init
super().init(loop=loop)
File "/usr/lib/python3.10/asyncio/mixins.py", line 17, in init
raise TypeError(
TypeError: As of 3.10, the loop* parameter was removed from Event() since it is no longer necessary
Proposed Solution:
To resolve the issue, the Virtual Lightning (vl) codebase should be updated to accommodate the changes made to the
virEventRegisterAsyncIOImpl
function in thelibvirtaio.py
file, leading to aTypeError
due to the removal of the loop parameter from theasyncio.Event()
constructor starting from Python 3.10. Steps to Reproduce: 1. Install Ubuntu 22.4 and Python 3.10.6 on the system. 2. Install Virtual Lightning (vl) version 2.3.0 using the command:pip install vl==2.3.0
. 3. Execute any vl command, such asvl up
. Expected Behavior: Virtual Lightning (vl) should run without any errors and perform the intended actions without issues. Actual Behavior: Upon running any vl command, the following traceback error is encountered: Traceback (most recent call last): File "/home/ali/.local/bin/vl", line 8, inasyncio.Event()
constructor in Python 3.10. The usage of the loop parameter should be removed from thelibvirtaio.py
file, and the code should be modified to work seamlessly with Python 3.10 and later versions. Workaround: As a temporary workaround, users can consider downgrading their Python version to one that is compatible with Virtual Lightning (vl) until an updated version of vl is released to address the issue. Alternatively, they can use Python 3.9.x or any version that still supports the loop parameter in theasyncio.Event()
constructor.