[PR #170] fix: catch NotImplementedError from effective_ids on Windows #149

Open
opened 2026-10-18 21:11:15 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-terminal/pull/170
Author: @ph1lsn
Created: 9/7/2026
Status: 🔄 Open

Base: main ← Head: windows-fix


📝 Commits (1)

  • dbd52e7 fix: catch NotImplementedError from effective_ids on Windows

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 open_terminal/utils/fs.py (+1 -1)

📄 Description

Summary

  • _is_writable_sync calls os.access(path, os.W_OK, effective_ids=True) and only catches TypeError as a fallback.
  • On Windows, this raises NotImplementedError (no setuid support), not TypeError, so the fallback never triggers.
  • Result: any call that lists a directory (GET /files/list) crashes on Windows bare-metal.

Fix

Broaden the except clause to also catch NotImplementedError:

try:
    return os.access(path, os.W_OK, effective_ids=True)
except (TypeError, NotImplementedError):
    return os.access(path, os.W_OK)

Test plan

  • Reproduced original crash on Windows bare-metal via uvx open-terminal run ...
  • Confirmed fix resolves GET /files/list 500 error locally
  • Maintainers to confirm no regression on other platforms (fallback behavior unchanged for non-Windows)

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-terminal/pull/170 **Author:** [@ph1lsn](https://github.com/ph1lsn) **Created:** 9/7/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `windows-fix` --- ### 📝 Commits (1) - [`dbd52e7`](https://github.com/open-webui/open-terminal/commit/dbd52e723127efab6814720e05fe91e4b3504755) fix: catch NotImplementedError from effective_ids on Windows ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `open_terminal/utils/fs.py` (+1 -1) </details> ### 📄 Description ## Summary - `_is_writable_sync` calls `os.access(path, os.W_OK, effective_ids=True)` and only catches `TypeError` as a fallback. - On Windows, this raises `NotImplementedError` (no setuid support), not `TypeError`, so the fallback never triggers. - Result: any call that lists a directory (`GET /files/list`) crashes on Windows bare-metal. ## Fix Broaden the except clause to also catch `NotImplementedError`: ```python try: return os.access(path, os.W_OK, effective_ids=True) except (TypeError, NotImplementedError): return os.access(path, os.W_OK) ``` ## Test plan - [x] Reproduced original crash on Windows bare-metal via `uvx open-terminal run ...` - [x] Confirmed fix resolves `GET /files/list` 500 error locally - [ ] Maintainers to confirm no regression on other platforms (fallback behavior unchanged for non-Windows) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/open-terminal#149
No description provided.