On 16May2019 1632, Victor Stinner wrote:
I'm working on my PEP 587 "Python Initialization Configuration": https://www.python.org/dev/peps/pep-0587/
I just proposed to add a new "configure_locale" configuration parameter to leave the LC_CTYPE locale unchanged: https://bugs.python.org/issue36945
Right now, Python always calls setlocale(LC_CTYPE, "") on all platforms to set the LC_CTYPE locale to the user preferred locale.
Is it a problem when Python is embedded in an application? Or am I trying to fix an artificial issue? :-)
I posted on the bug, but the answer to the question in the subject line is "no" :)
Embedding Python shouldn't change any global settings in your C runtime. We should be good citizens and work with whatever is there, and if it causes issues for the host application, then we can say "you should probably change this global setting".
So we don't need an option. We just have to move our setlocale() call from Py_Initialize() into Py_Main()