fix(windows): handle OSError from os.kill and add UTF-8 encoding for Windows (#5760, #8978, #7537, #8901)#13986
Closed
zhanggttry wants to merge 1 commit into
Closed
Conversation
…g to file reads - os.kill(pid, 0) on Windows raises OSError (WinError 87) for non-existent PIDs instead of ProcessLookupError. Catch OSError everywhere to prevent crash on Windows process-existence checks. - Path.read_text() and open() default to gbk on Chinese Windows. Add explicit encoding='utf-8' to all file reads to prevent UnicodeDecodeError when config files or skill manifests contain non-ASCII characters. Files changed: - gateway/run.py, gateway/status.py (os.kill + read_text) - hermes_cli/*.py (read_text + open) - tools/*.py (read_text) Closes: NousResearch#13587 NousResearch#5762 NousResearch#7835 NousResearch#9024
This was referenced Apr 22, 2026
Contributor
Author
|
Closing as the fixes (OSError handling in os.kill + UTF-8 encoding) have already been merged into main. The changes are functionally identical to what this PR proposed. Thanks! |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5760, #8978, #12359, #7537, #8901 — Windows compatibility issues in gateway and CLI.
Changes
gateway/status.py & gateway/run.py
hermes_cli/.py, tools/.py
Solution
No ctypes/windll usage — pure Python try/except and explicit encodings only. Safe for Supply Chain Audit.
Related Issues