[issue36204] Deprecate calling Py_Main() after Py_Initialize()? Add Py_InitializeFromArgv()?

Steve Dower report at bugs.python.org
Wed Mar 6 13:07:14 EST 2019


Steve Dower <steve.dower at python.org> added the comment:

> If you want to force the usage of UTF-8, you can opt-in for UTF-8 mode: call putenv("PYTHONUTF8=1") before Py_UnixMain() for example.

I'm not talking about forcing UTF-8, I'm talking about *assuming* it (and letting "someone else" worry about forcing it).

As I understand it UTF-8 mode, is about overriding the environment's apparent encoding and saying "skip our detection logic and always encode/decode via UTF-8". That is part of the encoding detection logic.

Our embedding APIs currently accept "whatever" and try to figure out the encoding on the inside. I'm proposing that they should accept "UTF-8" and the caller has to figure out the encoding (maybe with our helper functions).

That way embedders can just worry about UTF-8 consistently, instead of having to work around our workarounds for encoding detection.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36204>
_______________________________________


More information about the Python-bugs-list mailing list