On Tue, Feb 9, 2021 at 2:28 AM Christopher Barker <pythonchb@gmail.com> wrote:
And beginners should use a UTF-8 locale. Beginners may not know how to do that / have a choice.
This is a question I still don't know the answer to -- I think that most (all?) non Windows platforms currently supported use utf-8 -- but is that guaranteed? That is, might some platform come up that does need utf-8 mode? So why not have it available everywhere, even though it will be a no-op on most systems.
UTF-8 mode is provided for Unix because there is environments for *deployment*, like minimal Unix container image. They have only C locale.
For desktop use, I think all Unix environments suited for beginners use UTF-8 locale by default. There is no guarantee. But if default locale is not UTF-8, I don't think the environment is suited for beginners who learning to Python.
That's true, but not in Python's control.
But this is not just newbies -- see above, deployment and test (CI) environments might need it too.
Unlike Windows, environment variables work very fine for such use cases. On Unix, direnv, dotenv, and maybe more tools are there. It is not only for Python, but for projects.
Which is another good reason that having it be something that can be "turned on" by an virtual environment / requirements file would be very helpful.
There are direnv and dotenv. -- Inada Naoki <songofacandy@gmail.com>