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
This commit is contained in:
Alan Chow authored and GitHub committed 2026-10-10 19:18:15 +04:00
1 parent 2f595c1122
commit 613c0431d0
1 file changed
+1 -1
+1 -1
View File
@@ -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: