[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Python-Dev] New Python Initialization API

Le mer. 27 mars 2019 ? 19:35, Alexander Belopolsky
<alexander.belopolsky at gmail.com> a ?crit :
> Would you consider making _Py_UnixMain public as well?
> It is useful for high level embedding and not trivial for 3rd parties to reimplement.

Right, Py_Main() is causing a lot of practice issues, especially
mojibake because of the C locale coercion (PEP 538) and UTF-8 Mode
(PEP 540): both added in Python 3.7. I added that to the Rationale of
my PEP 587.

I just fixed the mojibake issue in Python 3.8 by disabling C locale
coercion and UTF-8 Mode by default. I'm not sure if nor how Python 3.7
should be fixed in a minor 3.7.x release.

Making _Py_UnixMain() public has already been discussed here:

My PEP 587 allows to pass command line arguments as bytes (char*) or
Unicode (wchar_t*).

Ok, I just added Py_UnixMain() to the PEP (just make it part of the public API).

Night gathers, and now my watch begins. It shall not end until my death.