From 9e36b46e04a9dee0625bccb61d666caef210d536 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:40:29 +0000 Subject: [PATCH 1/2] Initial plan From 91dfcec5798f1b90177c64aea0005896c53d1a91 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 19 Mar 2026 10:44:53 +0000 Subject: [PATCH 2/2] fix: replace deprecated distutils.copy_tree with shutil.copytree and 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> --- src/python/futag-package/src/futag/base_generator.py | 10 +++++----- src/python/futag-package/src/futag/generator.py | 1 - src/python/futag-package/tests/test_fuzzer.py | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/python/futag-package/src/futag/base_generator.py b/src/python/futag-package/src/futag/base_generator.py index 9c437241..8fb9662c 100644 --- a/src/python/futag-package/src/futag/base_generator.py +++ b/src/python/futag-package/src/futag/base_generator.py @@ -27,7 +27,7 @@ from subprocess import Popen, PIPE from multiprocessing import Pool from typing import List -from distutils.dir_util import copy_tree +from shutil import copytree from futag.sysmsg import * @@ -2515,8 +2515,8 @@ def compile_targets(self, workers: int = 4, keep_failed: bool = False, extra_par ((self.succeeded_path / dir.parents[1].name)).mkdir(parents=True, exist_ok=True) # shutil.move(dir.parents[0].as_posix(), (self.succeeded_path / dir.parents[1].name).as_posix(), copy_function=shutil.copytree) - copy_tree(dir.parents[0].as_posix( - ), (self.succeeded_path / dir.parents[1].name / dir.parents[0].name).as_posix()) + copytree(dir.parents[0].as_posix( + ), (self.succeeded_path / dir.parents[1].name / dir.parents[0].name).as_posix(), dirs_exist_ok=True) if keep_failed: failed_tree = set() @@ -2535,8 +2535,8 @@ def compile_targets(self, workers: int = 4, keep_failed: bool = False, extra_par ((self.failed_path / dir.parents[1].name)).mkdir(parents=True, exist_ok=True) # shutil.move(dir.parents[0].as_posix(), (self.failed_path / dir.parents[1].name).as_posix(), copy_function=shutil.copytree) - copy_tree(dir.parents[0].as_posix( - ), (self.failed_path / dir.parents[1].name / dir.parents[0].name).as_posix()) + copytree(dir.parents[0].as_posix( + ), (self.failed_path / dir.parents[1].name / dir.parents[0].name).as_posix(), dirs_exist_ok=True) else: delete_folder(self.failed_path) if not keep_original: diff --git a/src/python/futag-package/src/futag/generator.py b/src/python/futag-package/src/futag/generator.py index 955ebb20..eac45bf2 100644 --- a/src/python/futag-package/src/futag/generator.py +++ b/src/python/futag-package/src/futag/generator.py @@ -26,7 +26,6 @@ from subprocess import Popen, PIPE from multiprocessing import Pool from typing import List -from distutils.dir_util import copy_tree from futag.sysmsg import * from futag.preprocessor import * diff --git a/src/python/futag-package/tests/test_fuzzer.py b/src/python/futag-package/tests/test_fuzzer.py index 26962de6..55a2bf4b 100644 --- a/src/python/futag-package/tests/test_fuzzer.py +++ b/src/python/futag-package/tests/test_fuzzer.py @@ -49,7 +49,7 @@ def test_quote(self): def test_newline(self): fuzzer = BaseFuzzer.__new__(BaseFuzzer) - assert " " in fuzzer._xml_escape("a\nb") + assert "a b" == fuzzer._xml_escape("a\nb") class TestCorpusArgs: