Skip to content

auxiliary: use shutil instead of distutils for recursiveCopy#125

Open
tpwrules wants to merge 1 commit into
noseglasses:masterfrom
tpwrules:pr/fix-recursive-copy
Open

auxiliary: use shutil instead of distutils for recursiveCopy#125
tpwrules wants to merge 1 commit into
noseglasses:masterfrom
tpwrules:pr/fix-recursive-copy

Conversation

@tpwrules

@tpwrules tpwrules commented Jul 7, 2025

Copy link
Copy Markdown

distutils does not exist in Pythons >= 3.12, so the program does not work since the import fails. Instead, when possible, use shutil to provide a tree copy function.

The relevant difference between the two implementations is that distutils' version does not raise an error if the destination directory exists. Unfortunately, the flag to match this behavior, only exists in shutil's implementation on Pythons >= 3.8. Therefore, we fall back on distutils to preserve compatibility with these EOL versions.

Tested that elf_diff now starts and works on Python 3.12 using the html_dir exporter.

distutils does not exist in Pythons >= 3.12, so the program does not
work since the import fails. Instead, when possible, use shutil to
provide a tree copy function.

The relevant difference between the two implementations is that
distutils' version does not raise an error if the destination directory
exists. Unfortunately, the flag to match this behavior, only exists in
shutil's implementation on Pythons >= 3.8. Therefore, we fall back on
distutils to preserve compatibility with these EOL versions.

Tested that elf_diff now starts and works on Python 3.12 using the
`html_dir` exporter.
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.

1 participant