fix: specify UTF-8 encoding for text file operations#167
Merged
krisztianfekete merged 4 commits intoJul 8, 2026
Conversation
krisztianfekete
requested changes
Jul 7, 2026
krisztianfekete
left a comment
Contributor
There was a problem hiding this comment.
Please also cover the migration logic in cli.py, and others in sinks.py, sources.py, and venv.py so the we really cover all text mode operations.
Contributor
Author
I think have covered all the text operations and enforced UTF-8 encoding, please let me know if I missed anything |
Contributor
There was a problem hiding this comment.
Please enforce encoding here and in mcp_server.py as well.
krisztianfekete
approved these changes
Jul 8, 2026
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
This PR updates all text-mode file operations to explicitly specify
encoding="utf-8"when opening files.Previously,
open()relied on the platform's default encoding, which varies across operating systems (for example, UTF-8 on most Unix-based systems versus legacy code pages on Windows). This inconsistency was causing pytest failures on Windows.Changes
encoding="utf-8"to all text-modeopen()calls used for reading and writing files."rb"/"wb") file operations unchanged.