Skip to content

Conversation

@deveshjagwani
Copy link
Member

@deveshjagwani deveshjagwani commented Nov 6, 2025

ADO Task: 34492797

Fix Python 3.12 compatibility issues

  • Replace distutils.version with packaging/distutils/custom fallback in WaagentLib.py
  • Replace imp module with importlib.util fallback in WAAgentUtil.py
  • Fix invalid escape sequences in HandlerUtil.py JSON processing
  • Add setuptools fallback for distutils removal in setup.py

Resolves VMBackup extension failure on Debian 12 with Python 3.12. All changes maintain backward compatibility with older Python versions.

Fix platform.dist() deprecation error for Python 3.8+

  • Added conditional import for distro package
  • Implemented multi-tier fallback strategy in get_dist_info()
  • Enhanced error handling with proper logging
  • Maintains backward compatibility across all Python versions
  • Resolves AttributeError: module 'platform' has no attribute 'dist'

Fix Python 3.13+ compatibility: Handle deprecated crypt module import

  • Add try/except block for crypt import to handle Python 3.13+ where crypt module was removed
  • Update gen_password_hash() to gracefully handle missing crypt module
  • Add TODO comment for future cleanup of unused code in VMBackup extension
  • Maintains backward compatibility with older Python versions
  • Resolves import error while preserving all existing functionality

- Replace distutils.version with packaging/distutils/custom fallback in WaagentLib.py
- Replace imp module with importlib.util fallback in WAAgentUtil.py
- Fix invalid escape sequences in HandlerUtil.py JSON processing
- Add setuptools fallback for distutils removal in setup.py

Resolves VMBackup extension failure on Debian 12 with Python 3.12.
All changes maintain backward compatibility with older Python versions.
Devesh Jagwani added 2 commits November 6, 2025 12:18
- Added conditional import for distro package
- Implemented multi-tier fallback strategy in get_dist_info()
- Enhanced error handling with proper logging
- Maintains backward compatibility across all Python versions
- Resolves AttributeError: module 'platform' has no attribute 'dist'
- Add try/except block for crypt import to handle Python 3.13+ where crypt module was removed
- Update gen_password_hash() to gracefully handle missing crypt module
- Add TODO comment for future cleanup of unused code in VMBackup extension
- Maintains backward compatibility with older Python versions
- Resolves import error while preserving all existing functionality
Copy link
Contributor

@arisettisanjana arisettisanjana left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please share the extension logs with the updated changes using older and latest python versions

@deveshjagwani
Copy link
Member Author

deveshjagwani commented Nov 26, 2025

Extension success status result logs are present in the work item in PR description (ADO: 34492797). Also the rpc names are there @arisettisanjana

@arisettisanjana
Copy link
Contributor

Extension success status result logs are present in the work item in PR description (ADO: 34492797). Also the rpc names are there @arisettisanjana

The tests were run to verify on py3.13 versions so, just wanted to be sure that we have tested these changes for backward compatibility i.e with lesser python versions

@deveshjagwani
Copy link
Member Author

Extension success status result logs are present in the work item in PR description (ADO: 34492797). Also the rpc names are there @arisettisanjana

The tests were run to verify on py3.13 versions so, just wanted to be sure that we have tested these changes for backward compatibility i.e with lesser python versions

I haven't tested specifically for lesser python versions. But code will pickup the imports and logic for lesser python versions wherever needed.

@deveshjagwani deveshjagwani reopened this Nov 27, 2025
@deveshjagwani deveshjagwani merged commit 5d8f38c into master Nov 27, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants