fix(cli): avoid lint-translations UnicodeEncodeError on legacy consoles - #3006
Open
lntutor wants to merge 1 commit into
Open
fix(cli): avoid lint-translations UnicodeEncodeError on legacy consoles#3006lntutor wants to merge 1 commit into
lntutor wants to merge 1 commit into
Conversation
Co-Authored-By: Codex <codex@openai.com>
lntutor
requested review from
asvishnyakov,
hayescode and
sandangel
as code owners
July 31, 2026 13:42
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.
Fixes #2997
Summary
Verification
uv run --no-project pytest backend/tests/test_translations.pyuv run --no-project ruff check backend/chainlit/translations.py backend/tests/test_translations.pySummary by cubic
Prevents the CLI translation linter from crashing on consoles that can’t encode emojis (e.g., cp1252). Output now degrades safely instead of raising UnicodeEncodeError.
_safe_printto handle unencodable characters based onsys.stdout.encoding.printcalls with_safe_printin lint output.Written for commit 76b4752. Summary will update on new commits.