Repository navigation
fix: script output survives a console encoding such as cp1252 - #92
Merged
Merged
Conversation
Scripts printed non-ASCII JSON to stdout, which raises UnicodeEncodeError when an agent reads them through a pipe on Windows without UTF-8 mode. JSON on stdout is now ASCII-escaped in deeppapernote, paper-glossary, and research-memory; files written with --output stay UTF-8. run_pipeline's name=path lines switch stdout to UTF-8 instead, since escaped paths would not be usable. Tests run the scripts under PYTHONIOENCODING=cp1252. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Agents read script output through a pipe. On Windows without UTF-8 mode, that pipe uses the locale encoding, for example cp1252 or GBK. Printing non-ASCII JSON then raises
UnicodeEncodeError, and the script fails. CI never saw this because the workflow setsPYTHONUTF8=1.The fix covers these scripts:
common.emit,run_state.py,user_configuration.py,run_pipeline.pyglossary_common.emit,configure_glossary._emitaggregate_reading.py,write_research_memory.pyEvidence
The new tests run the scripts with
PYTHONIOENCODING=cp1252andPYTHONUTF8=0:tests/test_console_encoding.py: 4 tests;tests/test_console_encoding.pyUnicodeEncodeError: 'charmap' codec can't encode…)python3 -m pytest -qorganize-wiki already prints ASCII JSON, fixed in #91.
Merge Danger
Door: two-way.
Blast Radius: stdout format.
\uXXXXinstead of Chinese.--outputare unchanged.🤖 Generated with Claude Code