Skip to content

Fix Python 3.12 test failures: replace removed distutils module#115

Merged
thientc merged 2 commits into113-documentation-for-python-packagefrom
copilot/sub-pr-114
Mar 19, 2026
Merged

Fix Python 3.12 test failures: replace removed distutils module#115
thientc merged 2 commits into113-documentation-for-python-packagefrom
copilot/sub-pr-114

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 19, 2026

CI fails on Python 3.12 because distutils was removed from the stdlib (PEP 632).

  • base_generator.py: Replace from distutils.dir_util import copy_tree with from shutil import copytree, using dirs_exist_ok=True to preserve existing behavior
  • generator.py: Remove unused distutils import (inherited from BaseGenerator)
  • test_fuzzer.py: Fix test_newline assertion — _xml_escape replaces \n with space, not 


All 45 tests pass on Python 3.12.


📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

…fix test_newline assertion

- Replace `from distutils.dir_util import copy_tree` with `from shutil import copytree` in base_generator.py
- Remove unused distutils import from generator.py
- Use copytree(..., dirs_exist_ok=True) to match original copy_tree behavior
- Fix test_newline in test_fuzzer.py to match actual _xml_escape implementation

Co-authored-by: thientc <12711255+thientc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add custom exceptions for structured error handling in Futag Fix Python 3.12 test failures: replace removed distutils module Mar 19, 2026
Copilot AI requested a review from thientc March 19, 2026 10:46
@thientc thientc marked this pull request as ready for review March 19, 2026 10:47
@thientc thientc merged commit db5c4c9 into 113-documentation-for-python-package Mar 19, 2026
8 checks 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.

2 participants