fix(io): force UTF-8 on stdout/stderr and candidate writes#1
Open
diazMelgarejo wants to merge 1 commit into
Open
fix(io): force UTF-8 on stdout/stderr and candidate writes#1diazMelgarejo wants to merge 1 commit into
diazMelgarejo wants to merge 1 commit into
Conversation
Two related Windows-compatibility fixes: - Reconfigure stdout/stderr to UTF-8 (errors=replace) at import, so a lesson claim containing non-ASCII (arrows, em-dashes, accented text) doesn't raise UnicodeEncodeError under a cp1252 console on Windows. - Write the candidate JSON file with explicit encoding="utf-8" rather than the platform default, so candidates round-trip identically across OSes. Both are additive and platform-safe (the reconfigure is guarded by hasattr, a no-op where unavailable). Found and applied downstream in Perpetua-Tools; contributing back. Stacked on top of the episodic-mirror fix (atomic-01).
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.
Atomic PR 02 of 3
Summary
Two related Windows-compatibility fixes in
.agent/tools/learn.py:stdout/stderrto UTF-8 (errors=replace) at import, so a lesson claim containing non-ASCII text doesn't raiseUnicodeEncodeErrorunder acp1252console on Windows.encoding="utf-8"rather than the platform default, so candidates round-trip identically across OSes.Both are additive and safe (the
stdoutreconfigure is guarded byhasattr, a no-op where unavailable).Verification
Applied cleanly on top of #1 (this branch is based on
atomic-01-episodic-mirror-fix), syntax-checked. Found and applied downstream in Perpetua-Tools; contributing back.Stack
2 of 3 in a small related set — based on 1 of 3, # 3 will be based on this. See 1's description (codejunkie99#57) for the full context; each stands on its own merit.