From d75b41b6aea6366a7517ad839c8294a17f594cb9 Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Tue, 13 Jan 2026 11:33:19 +0100 Subject: [PATCH] scan_directory: Catch exceptions due to relative path conversion (e.g. nul device file on Windows) #931 --- src/serena/util/file_system.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/serena/util/file_system.py b/src/serena/util/file_system.py index 784fc2cf..3784a17a 100644 --- a/src/serena/util/file_system.py +++ b/src/serena/util/file_system.py @@ -52,7 +52,11 @@ def scan_directory( entry_path = entry.path if rel_base: - result_path = os.path.relpath(entry_path, rel_base) + try: + result_path = os.path.relpath(entry_path, rel_base) + except: + log.debug(f"Skipping entry due to relative path conversion error: {entry.path}") + continue else: result_path = entry_path