[Python-Dev] Re: [python-committers] Re: Accepting PEP 597 (Add optional EncodingWarning)

2021-03-15 Thread Inada Naoki
Thank you, Council members and all members joined in the long discussion.


On Tue, Mar 16, 2021 at 8:29 AM Guido van Rossum  wrote:
>
>>
>> Once the whole stdlib and most of top PyPI projects will be fixed to
>> no longer emit EncodingWarning, I will become safer to opt-in for
>> UTF-8 by default by enabling the Python UTF-8 Mode!
>> https://docs.python.org/dev/library/os.html#python-utf-8-mode
>>
>> One day, we will silently switch Python to UTF-8 by default, and
>> nobody will notice! ;-)
>
>
> In particular it's important that nobody living in Japan or China should 
> notice. This is also still the biggest challenge. :-(
>

Java has a very similar problem and proposal. See JEP 400 (*) that was
updated recently.
If JEP 400 is accepted, users can use `-Dfile.encoding=COMPAT` for
legacy behavior.
If UTF-8 mode is enabled by default, users can use `PYTHONUTF8=0` or
`-Xutf8=0` for legacy behavior.

(*) https://openjdk.java.net/jeps/400

Anyway, PEP 597 adds `encoding="locale"` option. Let's implement it in
Python 3.10 and wait 4 years.
Many libraries will use only UTF-8, or can drop Python 3.9 support and
use `encoding="locale"` where locale encoding is needed.

Regards,

-- 
Inada Naoki  
___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/EMYJ6KVCRNM3ZGPY6BWBVXHYBXIDPNU7/
Code of Conduct: http://python.org/psf/codeofconduct/


[Python-Dev] Re: [python-committers] Re: Accepting PEP 597 (Add optional EncodingWarning)

2021-03-15 Thread Guido van Rossum
On Mon, Mar 15, 2021 at 3:58 PM Victor Stinner  wrote:

> Congratulation INADA-san! I'm impressed by your tenacity :-)
>

+1. Great work!


> Last months, I followed your different propositions on
> discuss.python.org to use UTF-8 by default in Python. It's good to see
> the first non-controversial part being accepted! I hope that this PEP
> will help to move towards a world where we don't guess encodings
> anymore, but make them very explicit!
>

Actually, the "north star" here is a world where nobody has to think about
encodings any more. That, and world peace.


> Once the whole stdlib and most of top PyPI projects will be fixed to
> no longer emit EncodingWarning, I will become safer to opt-in for
> UTF-8 by default by enabling the Python UTF-8 Mode!
> https://docs.python.org/dev/library/os.html#python-utf-8-mode
>
> One day, we will silently switch Python to UTF-8 by default, and
> nobody will notice! ;-)
>

In particular it's important that nobody living in Japan or China should
notice. This is also still the biggest challenge. :-(

-- 
--Guido van Rossum (python.org/~guido)
*Pronouns: he/him **(why is my pronoun here?)*

___
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/BSG76KC7RK4U6JE5C6PTILKNR44HUOJ7/
Code of Conduct: http://python.org/psf/codeofconduct/