Skip to content

fix: add encoding='utf-8' to remaining read_text() calls (batch 3) - #51761

Closed
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/add-encoding-read-text-batch3
Closed

fix: add encoding='utf-8' to remaining read_text() calls (batch 3)#51761
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:fix/add-encoding-read-text-batch3

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

What

Add encoding='utf-8' to the final 38 remaining Path.read_text() calls across 16 files.

Why

On Windows with non-UTF-8 locale (e.g. cp936/GBK), read_text() without explicit encoding uses the system locale, causing UnicodeDecodeError on valid UTF-8 files.

Complements PR #51748 (batch 1, 15 files) and #51752 (batch 2, 11 files).

Changes (16 files, 38 lines)

File Changes
tools/skills_hub.py 6
hermes_cli/profiles.py 5
hermes_cli/doctor.py 3
hermes_cli/auth.py 3
plugins/memory/mem0/_setup.py 3
plugins/memory/hindsight/__init__.py 3
plugins/hermes-achievements/dashboard/plugin_api.py 3
hermes_cli/uninstall.py 2
plugins/platforms/whatsapp/adapter.py 2
plugins/disk-cleanup/disk_cleanup.py 2
hermes_cli/service_manager.py 1
hermes_cli/container_boot.py 1
plugins/platforms/google_chat/adapter.py 1
plugins/memory/mem0/__init__.py 1
plugins/memory/honcho/__init__.py 1
plugins/google_meet/realtime/openai_client.py 1

After this PR, zero .read_text() calls without encoding remain in production code.

Final cleanup of Path.read_text() calls without explicit encoding.
On Windows with non-UTF-8 locale, the default encoding is the system
locale, causing UnicodeDecodeError on valid UTF-8 files.

16 files, 38 lines changed:
- tools/skills_hub.py (6), hermes_cli/profiles.py (5)
- hermes_cli/doctor.py, auth.py, plugins/memory/mem0/_setup.py,
  plugins/memory/hindsight/__init__.py,
  plugins/hermes-achievements/dashboard/plugin_api.py (3 each)
- hermes_cli/uninstall.py, plugins/platforms/whatsapp/adapter.py,
  plugins/disk-cleanup/disk_cleanup.py (2 each)
- hermes_cli/service_manager.py, container_boot.py,
  plugins/platforms/google_chat/adapter.py, plugins/memory/mem0/__init__.py,
  plugins/memory/honcho/__init__.py,
  plugins/google_meet/realtime/openai_client.py (1 each)

All changes: .read_text() -> .read_text(encoding='utf-8')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows tool/skills Skills system (list, view, manage) type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants