Azure / azure-linux-extensions

Linux Virtual Machine Extensions for Azure
Apache License 2.0
309 stars 255 forks source link

Support for python3.12 #1920

Closed arisettisanjana closed 6 months ago

arisettisanjana commented 6 months ago

Guest VMs running Python version 3.12 or higher, VmSnapshotLinux extension fails with error message - importlib module missing the load_source attribute. This error occurs due to updates in Python 3.12+ that affected certain attributes within the importlib module.

To address this issue and ensure compatibility with Python 3.12, the code is modified to handle the absence of the load_source attribute gracefully. In addition to that made changes to address the new SyntaxWarning applicable to Python 3.12 (Invalid backslash escape sequences in strings previously warn with DeprecationWarning now warn as SyntaxWarning).

iamashwani-who commented 6 months ago

Updated description of the PR