From 4bd587a1dece73b1401a03d28f4f37134ed62641 Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:07 +0100 Subject: [PATCH 1/2] rtti_scan: ask report_paths for the report-path guard --- tools/rtti_scan.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/rtti_scan.py b/tools/rtti_scan.py index a108f6fbae..207c4ba5ec 100644 --- a/tools/rtti_scan.py +++ b/tools/rtti_scan.py @@ -24,6 +24,7 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from file_mode import published_mode # noqa: E402 +from report_paths import same_report_path # noqa: E402 @@ -519,12 +520,7 @@ def main(): print(f"ERROR: {a.image}: does not exist", file=sys.stderr) return 2 path = a.out or re.sub(r"\.(exe|dll)$", "", a.image, flags=re.I) + ".rtti.json" - same_path = os.path.normcase(os.path.realpath(a.image)) == os.path.normcase(os.path.realpath(path)) - try: - same_path = same_path or os.path.samefile(a.image, path) - except OSError: - pass # A missing or inaccessible path is handled by the normal read/write error path. - if same_path: + if same_report_path(a.image, path): ap.error("output must not overwrite the source image") try: with open(a.image, "rb") as f: From 5f57870750e4c6fa624dd95a6225162a3ff1165b Mon Sep 17 00:00:00 2001 From: Enea Cortese <148778899+breachato@users.noreply.github.com> Date: Mon, 30 Nov 2026 19:43:08 +0100 Subject: [PATCH 2/2] tests: list rtti_scan in SHARED The reviewers' red test: with this entry on main, test_switched_tools_import_the_helper_and_define_no_copy fails with "'from report_paths import same_report_path' not found"; with this branch it passes. --- tests/test_report_paths.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_report_paths.py b/tests/test_report_paths.py index 5a22fe2cc5..ab920c1831 100644 --- a/tests/test_report_paths.py +++ b/tests/test_report_paths.py @@ -22,7 +22,7 @@ # Tools that use report_paths and must not define their own copy again. SHARED = ("anim_index", "awc_manifest", "bink_index", "gamedata_index", "gamedata_xml", "gen_d3d12_stubs", - "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "tile_probe", "world_index", + "glb_inspect", "meshlet_page", "navmesh_index", "rpf_probe", "rtti_scan", "tile_probe", "world_index", "world_lights_paths", "world_names") # The one tool that still carries its own copy (an open pull request edits its call site). Do not add to this list: # import report_paths instead.