fix: add encoding=utf-8 to file open calls in playwright_controller#7470
Open
1Ckpwee wants to merge 1 commit intomicrosoft:mainfrom
Open
fix: add encoding=utf-8 to file open calls in playwright_controller#74701Ckpwee wants to merge 1 commit intomicrosoft:mainfrom
1Ckpwee wants to merge 1 commit intomicrosoft:mainfrom
Conversation
On non-English Windows systems, Python defaults to the system encoding (e.g., cp1252, gbk), which causes UnicodeDecodeError when reading or writing files containing non-ASCII characters. This adds explicit encoding='utf-8' to all text-mode open() calls that were missing it in _docker_jupyter.py, page_logger.py, and chat_completion_client_recorder.py. Relates to microsoft#5566
Contributor
|
@1Ckpwee please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Author
@microsoft-github-policy-service agree |
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
Adds explicit
encoding='utf-8'parameter toopen()calls inautogen-extthat are missing it. On non-English Windows systems, Python defaults to the system encoding (e.g., cp1252, gbk), which causesUnicodeDecodeErrorwhen reading/writing files containing non-ASCII characters.Files fixed:
code_executors/docker_jupyter/_docker_jupyter.py— HTML file writingexperimental/task_centric_memory/utils/page_logger.py— log/HTML file writing (3 calls)experimental/task_centric_memory/utils/chat_completion_client_recorder.py— JSON session file read/write (2 calls)Note: The original
playwright_controller.pyfix was already merged via PR #6094. This PR addresses the remainingopen()calls in the same package that have the same issue.Closes #5566
Test plan
open()calls in the affected files now specify encoding