Repository navigation
fix: read password file and contributor/sponsor/tip files as UTF-8 - #2444
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
rolandwalker
approved these changes
Nov 18, 2026
Contributor
|
Thanks! The only thing I could ask for is a more concise changelog entry. |
Contributor
|
Released in https://github.com/dbcli/mycli/releases/tag/v2.31.1 ! |
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.
Follow-up to #2429 and #2432: the same locale-encoding bug in the remaining
open()calls.Description
get_password_from_file(main.py) and theAUTHORS.txt,SPONSORS.txtandTIPS.txtreaders inmain_modes/repl.pyopened files with the locale's default encoding. Under a non-UTF-8 locale (Windows cp1252/cp932,LANG=C) a UTF-8 password file with non-ASCII characters is mis-decoded (wrong password) or rejected, and contributor names with accents show up as mojibake or raiseUnicodeDecodeError. The config, history,/sourceand audit/tee files already passencoding='utf-8'; these four calls were missing it.Fix: pass
encoding='utf-8'in the four places, plus a changelog entry.Tests: two new tests run the code in a subprocess with
-X warn_default_encoding -W error::EncodingWarning, which fails onmain(EncodingWarning: 'encoding' argument not specified) and passes with the fix. TheFakeResourceTree.opentest double now accepts the extra keyword.Disclosure: this change was prepared with the help of an AI coding assistant (Claude); the submitter is responsible for it.
Checklist
changelog.mdfile.mycli/AUTHORS.txtfile (or it's already there).ruff checkandruff format --checkpass on the touched files;mypynot run (only anencodingkeyword was added).