Fix UnicodeEncodeError in gtn config list on cp1252 consoles - #5489
Open
ClaraOswald076 wants to merge 2 commits into
Open
ClaraOswald076 wants to merge 2 commits into
ClaraOswald076 wants to merge 2 commits into
Conversation
collindutter
requested changes
Sep 14, 2026
collindutter
left a comment
Member
There was a problem hiding this comment.
@ClaraOswald076 it looks like some checks are failing, could you please get them passing? Otherwise PR is good with me!
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Author
|
Fixed the lint and type-check failures in 26571df — the test now passes ruff (annotations) and pyright (captures console output via an explicit |
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 #5470.
gtn config listprinted its header containing U+27F6 (⟶, long rightwardsarrow) and then crashed with
UnicodeEncodeError: 'charmap' codec can't encode character '\u27f6'on any Windows console/pipe whose stdout encoding is thelegacy cp1252 code page. This replaces that one character with the ASCII arrow
->, so the command works on every console.Changes
src/griptape_nodes/cli/commands/config.py:⟶->->in the_list_user_configs()header, plus a comment explaining why the charactermust stay ASCII
tests/unit/cli/commands/test_config.py(new): regression test that swapsthe shared console for one writing through a strict-cp1252
BytesIOwrapperand asserts
_list_user_configs()completes without raisingTest evidence
Windows, Python 3.12.13, pytest 9.1.1.
Before (upstream code with the regression test applied, via
git stash):End-to-end repro on upstream code (cp1252 stdout):
After:
pytest tests/unit/cli -q: main baseline4 failed, 15 passedvs this branch4 failed, 16 passed— the 4 failures are pre-existing network-dependentdoctor/websocket tests, unrelated to this change; no regressions.
Note:
src/griptape_nodes/cli/commands/libraries.pylines 53/56 use✓/→/✗,which have the same cp1252 failure mode. Left out of this PR to keep it scoped
to the reported command; happy to follow up.