-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: Ensure UTF-8 encoding in all 'open()' statements #5818
base: main
Are you sure you want to change the base?
Conversation
@microsoft-github-policy-service agree |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5818 +/- ##
=======================================
Coverage 75.35% 75.35%
=======================================
Files 177 177
Lines 11421 11421
=======================================
Hits 8606 8606
Misses 2815 2815
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@rysweet Hey, I saw that the conflicts were resolved earlier—thanks for that! I fixed the new ones yesterday. Let me know if there’s anything else I should do before review! |
Why explicitly specify utf-8 and not rely on the default behavior? https://docs.python.org/3/library/functions.html#open
EDIT: Hmm I can see the merit of just going all in on utf-8 https://peps.python.org/pep-0597/ |
Agreed! Explicitly setting UTF-8 ensures consistency across platforms. Let me know if any changes are needed. |
Why are these changes needed?
This PR ensures consistent UTF-8 encoding across all file operations by adding
encoding="utf-8"
to allwith open()
statements.This prevents potential encoding issues when running the code in different environments.
Related issue number
Closes #5566
Checks