From 613c0431d06f62ded09e32afc7bc3173f1a0ca94 Mon Sep 17 00:00:00 2001 From: Alan Chow <112228359+Chowwyie@users.noreply.github.com> Date: Sat, 10 Oct 2026 08:18:15 -0700 Subject: [PATCH] Fix _is_writable_sync Windows compatibility (NotImplementedError) (#179) - Catch NotImplementedError as the primary fallback since os.access(..., effective_ids=True) is not implemented on Windows - Also catch AttributeError, OSError, and TypeError as supplementary guards - Prevents crashes when checking file writability on Windows platforms, primarily fixing directory listing operations (/files/list, stat, listdir) Fixes #174 --- open_terminal/utils/fs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/open_terminal/utils/fs.py b/open_terminal/utils/fs.py index acb79da..47ad5e1 100644 --- a/open_terminal/utils/fs.py +++ b/open_terminal/utils/fs.py @@ -192,7 +192,7 @@ class UserFS: pass try: return os.access(path, os.W_OK, effective_ids=True) - except TypeError: + except (TypeError, OSError, NotImplementedError, AttributeError): return os.access(path, os.W_OK) async def is_writable(self, path: str) -> bool: