GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — GH-133711: Enable UTF-8 mode by default (PEP 686) by AA-Turner · Pull Request #133712 · python/cpython Conversation
|
| * Python UTF-8 mode is now enabled by default. | ||
| It may be disabled with by setting :envvar:`PYTHONUTF8=0 <PYTHONUTF8>` as | ||
| an environment variable or by using the :option:`-X utf8=0 <-X>` flag. | ||
| See :pep:`686` for further details. |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I feel like we can probably put some more explanation in here, such as that it affects TextIOWrapper and hence open(). The current description doesn't sound as scary as it needs to, in my opinion.
Along the lines of: "Python UTF-8 mode is now enabled by default. This means that (files/console/etc.) will now use UTF-8 regardless of system settings, unless specifically overridden in code (typically with an encoding= argument)."
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
To be clear, it's nothing new. But we shouldn't assume that everyone already knows what UTF-8 mode implies. There are many more people out there who haven't ever thought about it than those who are waiting for it to be the default.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Another effect of the UTF-8 Mode is that Python ignores the locale encoding.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I've expanded the What's New entry, please see https://cpython-previews--133712.org.readthedocs.build/en/133712/whatsnew/3.15.html#other-language-changes
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
| ====================== | ||
|
|
||
|
|
||
| * Python now uses UTF-8_ as the default encoding, independent of the system's |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
You might mention the UTF-8 Mode earlier since it has other side effects documented in the UTF-8 Mode section, such as changing sys.stdout error handler and ignoring the locale encoding.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
"default encoding" is UTF-8 since Python 3.0. (e.g. sys.getdefaultencoding())
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
# Conflicts: # Doc/whatsnew/3.15.rst
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
I wrote #134839 to fix test_regrtest when PYTHONUTF8=1 env var is set. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
I wrote #134841 to fix test_readline for the Python UTF-8 Mode. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Configure host Python fails with: It seems to be unrelated to this PR. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
cc @brettcannon, this builder seems to be consistently failing since ~15/05. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
|
Ping @AA-Turner, I made two suggestions. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
In fact, it would be safe to run this PR on buildbots before merging it. I will wait until GitHub CIs complete first. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
🤖 New build scheduled with the buildbot fleet by @vstinner for commit 3130318 🤖 Results will be shown at: https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F133712%2Fmerge If you want to schedule another build, you need to add the 🔨 test-with-buildbots label again. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Thanks @vstinner! A |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Co-authored-by: Victor Stinner <[email protected]>
Co-authored-by: Victor Stinner <[email protected]>
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.