-
Notifications
You must be signed in to change notification settings - Fork 31
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
Open all text files with UTF-8 encoding #373
Conversation
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #373 +/- ##
==========================================
+ Coverage 33.59% 33.64% +0.04%
==========================================
Files 51 51
Lines 7030 7030
Branches 1784 1784
==========================================
+ Hits 2362 2365 +3
+ Misses 4488 4485 -3
Partials 180 180
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -639,7 +639,7 @@ def cluster_number(): | |||
# ask for help: how does one do a dendrogram, also without graphing? | |||
|
|||
if o is not None: | |||
f = open(o, "a") | |||
f = open(o, "a", encoding="utf-8", encoding="utf-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one too many ;)
f = open(o, "a", encoding="utf-8", encoding="utf-8") | |
f = open(o, "a", encoding="utf-8") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
well, some of those files should not even be utf8 but AFAIK should be ascii... but I guess it would generally be more robust etc to just generally assume UTF-8 these days. |
🚀 PR was released in |
Calling
open()
without an explicit encoding uses the OS encoding, which is not always sensible. See PEP 597 et alii.