add utf encoding in websurfer read file#6094
Merged
victordibia merged 1 commit intomainfrom Mar 25, 2025
Merged
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #6094 +/- ##
=======================================
Coverage 76.75% 76.75%
=======================================
Files 191 191
Lines 13226 13226
=======================================
Hits 10152 10152
Misses 3074 3074
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
afourney
approved these changes
Mar 25, 2025
Sean-Kenneth-Doherty
added a commit
to Sean-Kenneth-Doherty/autogen
that referenced
this pull request
Jan 31, 2026
This follows up on issue microsoft#5566 and PR microsoft#6094 which fixed the same issue in playwright_controller.py. The task_centric_memory module has similar file operations without explicit encoding, which can cause UnicodeDecodeError on non-English Windows systems (e.g., cp950, gbk). Files fixed: - chat_completion_client_recorder.py: session file read/write - page_logger.py: hash file, call tree HTML, and page HTML writes Without explicit encoding, Python uses the system default encoding which varies by locale (cp950 for Traditional Chinese Windows, cp936 for Simplified Chinese, etc.) and may fail to decode UTF-8 content.
3 tasks
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.
Why are these changes needed?
Add utf encoding to file reading.
Without this, a default system encoding will be used. On Windows machines this can default to any local encoding causing errors.
Related issue number
Closes #6093
Checks