-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
Update to check for proper UTF8 on Windows #2174
Conversation
Before I approve, note that we usually use I was tempted to dismiss the PR because we don't officially support Windows (someone would have to actually test Sopel on Windows, and we don't do that), however the fix is rather simple, and shouldn't be a problem. Also, I'm not even sure that this warning is legitimate anymore, as I don't recall Python 3.6+ doing anything out of the ordinary when the system is not utf-8. I mean... unless someone did something really wrong with stdout... |
I misunderstood the contributing docs when I made the commit then, my apologies.
I normally don't use windows for things, but was trying to setup a quick touch dev environment and was running into this. I'm not sure of the validity of the Python warning though. |
Hopping around through some blog posts from random people eventually led me to find PEP 540, which talks about assuming UTF-8 for the C locale on Unix starting in Python 3.7. I've reached my limit for text encoding nonsense today, but it sounds like we do still need this check at present. Python under Windows also allegedly uses different encoding modes depending on how it's run (lost the source link for this one mid-rabbit-hole, sadly), but we won't concern ourselves with that one. |
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.
I would just amend the commit message myself, but since this commit is signed I'm sure @Gizmokid2005 would prefer to do it and keep the lovely green badge. Our usual format for this commit message would look like:
sopel: Update to check for proper UTF8 on Windows
The locale.getlocale() check currently looks for "UTF-8" only, however
on windows with powershell and UTF8 enabled the return value is "utf8"
so this check still fails.
Thanks! I'll get the commit amended today. |
The locale.getlocale() check currently looks for UTF-8 only, however on windows with powershell and UTF8 enabled the return value is utf8 so this check still fails.
@dgw - Sorry about the noise (this is actually a first time I've amended a commit and well...Monday didn't go smoothly. Should be good now, let me know if you need anything else from me! |
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.
Oops, we lost the green "Verified" badge anyway, but it sounds like you probably learned something about amending. Not a total loss? 😸
Update to check for proper UTF8 on Windows Corresponds to (from master): 710a20d
The locale.getlocale() check currently looks for "UTF-8" only, however on windows with powershell and UTF8 enabled the return value is "utf8" so this check still fails.
Description
Fixes #2173
Checklist
make qa
(runsmake quality
andmake test
)