mirror of
https://github.com/open-webui/open-terminal.git
synced 2026-11-04 08:10:53 +00:00
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:
1 parent
2f595c1122
commit
613c0431d0
1 file changed
+1
-1
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user