[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
STINNER Victor added the comment: New changeset bcfbbd704646622e919c1306a91fba61d603483d by Victor Stinner in branch 'master': bpo-36945: Add _PyPreConfig.configure_locale (GH-13368) https://github.com/python/cpython/commit/bcfbbd704646622e919c1306a91fba61d603483d --

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower
Steve Dower added the comment: > I suggest to move this discussion on the WIP PR of 4th version of my PEP I prefer to keep it on the issue tracker where it doesn't disappear when merged and I get proper notifications. (I want to make the most of getting good notifications of new comments

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
STINNER Victor added the comment: I asked on Twitter: "If you embed Python in your application, would you prefer Python to leave your locale unchanged?" Mai Giménez replied: "I would like to." https://twitter.com/maidotgimenez/status/1129357352774393856 Steve Dower wrote: "I think this

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
STINNER Victor added the comment: > Nice, these will be helpful. Probably a good thing to try out with some > embedders too, to see whether they're intuitive enough. I suggest to move this discussion on the WIP PR of 4th version of my PEP: https://github.com/python/peps/pull/1056 I will

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower
Steve Dower added the comment: > * customized Python interpreter: behaves as the "regular Python" For this, why wouldn't we say "start by copying all the code in Programs/python.c"? Is there any reason why that file needs to only be one single call into Py_Main? Maybe there's some reason

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower
Steve Dower added the comment: > I have a very good news for you :-) Slowly but steadily, we converge on a > agreement ;-) Yay! :) > I added 2 functions … Nice, these will be helpful. Probably a good thing to try out with some embedders too, to see whether they're intuitive enough. (I

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
STINNER Victor added the comment: Steve: > Imagine you're an existing application and you want to embed Python. Why > would you ever want it to suddenly change your global settings like this? I have a very good news for you :-) Slowly but steadily, we converge on a agreement ;-) The more

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread Steve Dower
Steve Dower added the comment: I think this should be opt-in, not opt-out. Imagine you're an existing application and you want to embed Python. Why would you ever want it to suddenly change your global settings like this? As a general rule, an embedded Python runtime should deal with all

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
STINNER Victor added the comment: > Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when > embedding Python This parameter is similar the _PyCoreConfig.configure_c_stdio parameter that I just added. It allows to behave more as a "regular Python" or to better "isolate

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-17 Thread STINNER Victor
STINNER Victor added the comment: > I'm not sure if it's real issue in practice. Maybe users learnt how to > workaround this limitation. I sent an email to capi-sig to get a feedback on this question :-)

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-16 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +13278 stage: -> patch review ___ Python tracker ___ ___

[issue36945] Add _PyPreConfig.configure_locale: allow to leave LC_CTYPE unchanged when embedding Python

2019-05-16 Thread STINNER Victor
New submission from STINNER Victor : Py_Initiliaze() always call setlocale(LC_CTYPE, "") on all platforms to set the LC_CTYPE locale to the user preferred locale. That's fine when Py_Main() is used: when Python is the only "owner" of a process. I'm not sure that it's fine when Python is