Skip to content

fix(plugins): add explicit encoding to read_text/write_text in plugins/ - #51185

Closed
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:alex/fix-encoding-plugins
Closed

fix(plugins): add explicit encoding to read_text/write_text in plugins/#51185
AlexFucuson9 wants to merge 1 commit into
NousResearch:mainfrom
AlexFucuson9:alex/fix-encoding-plugins

Conversation

@AlexFucuson9

Copy link
Copy Markdown
Contributor

Summary

Add encoding="utf-8" to all read_text()/write_text() calls in plugins/ directory.

Path.read_text() defaults to system locale (cp1252 on Windows), causing UnicodeDecodeError for UTF-8 content. Ruff rule PLW1514.

Files fixed

  • Platform adapters: slack, discord, telegram, feishu, whatsapp, google_chat
  • Memory plugins: mem0, hindsight, honcho
  • Other: disk-cleanup, google_meet, hermes-achievements

Test plan

  • python3 -m py_compile passes for all files
  • All unencoded calls fixed

Fix 13 plugin files with unencoded read_text()/write_text() calls.
Path.read_text() defaults to system locale (cp1252 on Windows).
Ruff rule PLW1514.
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/plugins Plugin system and bundled plugins platform/discord Discord bot adapter platform/telegram Telegram bot adapter platform/feishu Feishu / Lark adapter platform/whatsapp WhatsApp Business adapter tool/memory Memory tool and memory providers sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows labels Jun 23, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

This was generated by AI during triage.

Related: #50689 (your broader open fix(plugins,scripts) encoding rollout). 12 of the 13 plugin files changed here are an exact subset of #50689; the only file unique to this PR is plugins/memory/mem0/_setup.py. Not a duplicate (subset of the broader PR), but reviewers may prefer to fold the one extra file into #50689 and close this, or merge this and drop the overlap from #50689 — to avoid conflicting edits to the same lines.

@tonydwb tonydwb left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review Summary

Verdict: Approved

Adds explicit encoding="utf-8" to read_text/write_text calls in the plugins/ directory (13 files, 34 additions). Consistent with the encoding fix pattern applied across the codebase. Well-scoped, no side effects.


Reviewed by Hermes Agent

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have platform/discord Discord bot adapter platform/feishu Feishu / Lark adapter platform/telegram Telegram bot adapter platform/whatsapp WhatsApp Business adapter sweeper:risk-platform-windows Sweeper risk: may break or behave differently on native Windows tool/memory Memory tool and memory providers type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants