From c88df865b4bc4023b475e63d7956377cd6539247 Mon Sep 17 00:00:00 2001 From: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:51:26 +0100 Subject: [PATCH 1/3] bvh_tri_probe: name a --json directory as typed, not through repr() repr() quotes the path and doubles every backslash on Windows, while the write-error line below it already prints the path as typed. --- tools/bvh_tri_probe.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bvh_tri_probe.py b/tools/bvh_tri_probe.py index 9101ce0c3e..a14549c081 100644 --- a/tools/bvh_tri_probe.py +++ b/tools/bvh_tri_probe.py @@ -1007,7 +1007,7 @@ def main(argv=None): return 2 kernels = [k for k in kernels if k.label in args.kernel] if args.json_out is not None and (not args.json_out.strip() or os.path.isdir(args.json_out)): - print(f"error: --json {args.json_out!r} is not a file path", file=sys.stderr) + print(f"error: --json {args.json_out.strip() or '(empty)'} is not a file path", file=sys.stderr) return 2 if args.list: for k in kernels: From 0ac85c72f782df7b0a829632e944f2c2ccbf31d9 Mon Sep 17 00:00:00 2001 From: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:51:38 +0100 Subject: [PATCH 2/3] test_bvh_tri_probe: the --json directory error names the path as typed Fails on the previous commit: repr() turned C:\\Users\\...\\tmp into 'C:\\\\Users\\\\...\\\\tmp'. --- tests/test_bvh_tri_probe.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_bvh_tri_probe.py b/tests/test_bvh_tri_probe.py index b8a57165f0..8022b2f80e 100644 --- a/tests/test_bvh_tri_probe.py +++ b/tests/test_bvh_tri_probe.py @@ -211,6 +211,14 @@ def test_bad_arguments_rejected_before_open_oracle(self): self.assertEqual(probe.main(argv), 2) self.assertIn("error:", err.getvalue()) + def test_json_directory_is_named_as_typed(self): + # every other diagnostic in this tool prints the path the user typed; repr() doubled each backslash + with tempfile.TemporaryDirectory() as tmp: + err = io.StringIO() + with redirect_stderr(err): + self.assertEqual(probe.main(["--json", tmp]), 2) + self.assertEqual(err.getvalue(), f"error: --json {tmp} is not a file path\n") + def test_write_kernels(self): with tempfile.TemporaryDirectory() as tmp, redirect_stdout(io.StringIO()): self.assertEqual(probe.main(["--write-kernels", tmp, "--kernel", "tri_g4b"]), 0) From 249d190db8b415c6e6c178dbb7e9f7b02b4e7724 Mon Sep 17 00:00:00 2001 From: evilclanker9000 <45567075+evilclanker9000@users.noreply.github.com> Date: Mon, 23 Nov 2026 15:51:43 +0100 Subject: [PATCH 3/3] test_bvh_tri_probe: an empty --json value is reported as (empty), not as '' With the path echoed as typed, a blank value would leave a gap in the message; say (empty) instead. --- tests/test_bvh_tri_probe.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_bvh_tri_probe.py b/tests/test_bvh_tri_probe.py index 8022b2f80e..11a259a7fd 100644 --- a/tests/test_bvh_tri_probe.py +++ b/tests/test_bvh_tri_probe.py @@ -219,6 +219,13 @@ def test_json_directory_is_named_as_typed(self): self.assertEqual(probe.main(["--json", tmp]), 2) self.assertEqual(err.getvalue(), f"error: --json {tmp} is not a file path\n") + def test_json_empty_is_a_named_error(self): + # an empty --json value cannot be echoed as a path; the message says (empty) instead of showing '' + err = io.StringIO() + with redirect_stderr(err): + self.assertEqual(probe.main(["--json", " "]), 2) + self.assertEqual(err.getvalue(), "error: --json (empty) is not a file path\n") + def test_write_kernels(self): with tempfile.TemporaryDirectory() as tmp, redirect_stdout(io.StringIO()): self.assertEqual(probe.main(["--write-kernels", tmp, "--kernel", "tri_g4b"]), 0)