From b3b24ebfe6559866ba6d89acdb355001ca935c1a Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Thu, 17 Jul 2025 16:45:39 +0200 Subject: [PATCH] Make opening robust on Windows, using notepad.exe as a fallback --- src/serena/cli.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/serena/cli.py b/src/serena/cli.py index aa77660..d80bdbd 100644 --- a/src/serena/cli.py +++ b/src/serena/cli.py @@ -37,7 +37,10 @@ def _open_in_editor(path: str) -> None: if editor: subprocess.run([editor, path], check=False) elif sys.platform.startswith("win"): - os.startfile(path) + try: + os.startfile(path) + except OSError: + subprocess.run(["notepad.exe", path], check=False) elif sys.platform == "darwin": subprocess.run(["open", path], check=False) else: