microsoft / vsts-azurevm-extension

MIT License
13 stars 6 forks source link

Incompatibility with python 3.12: No module named 'imp' #233

Open asbiin opened 1 week ago

asbiin commented 1 week ago

The Ubuntu 24.04 version of runner-images is using python 3.12 as a default.

Python 3.12 removed the imp module, so this extension is not compatible with python 3.12:

2024-06-18T12:27:53.623732Z ERROR ExtHandler ExtHandler Event: name=Microsoft.VisualStudio.Services.TeamServicesAgentLinux, op=Install, message=[ExtensionOperationError] Non-zero exit c
ode: 1, /var/lib/waagent/Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.23.0.1/Handler.sh
[stdout]

[stderr]
Traceback (most recent call last):
  File "/var/lib/waagent/Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.23.0.1/./AzureRM.py", line 9, in <module>
    import Utils.HandlerUtil as Util
  File "/var/lib/waagent/Microsoft.VisualStudio.Services.TeamServicesAgentLinux-1.23.0.1/Utils/HandlerUtil.py", line 58, in <module>
    import imp
ModuleNotFoundError: No module named 'imp'
ncook-hxgn commented 2 days ago

Deprecated since version 3.4, will be removed in version 3.12: The imp module is deprecated in favor of importlib.

https://docs.python.org/3.11/library/imp.html

🤞I hope it's an easy migration