[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-24 Thread Nick Coghlan
Nick Coghlan added the comment: Since we decided the correct resolution here was to restore the Python 3.6 behaviour, I've filed https://bugs.python.org/issue34206 as a separate docs clarification issue (I'll amend my PR accordingly) -- resolution: -> fixed stage: patch review ->

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread STINNER Victor
STINNER Victor added the comment: Ok, I fixed the fontforge bug in 3.7 and master branches. Sorry for the regression, but I really didn't expect that anyone would call Py_Main() after Py_Initialize() :-) I guess we should be prepared for such hiccup when reworking the Python initialization

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset 03ec4df67d6b4ce93a2da21db7c84dff8259953f by Victor Stinner (Miss Islington (bot)) in branch '3.7': bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043) (GH-8352)

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread miss-islington
Change by miss-islington : -- pull_requests: +7887 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread STINNER Victor
STINNER Victor added the comment: New changeset fb47bca9ee2d07ce96df94b4e4abafd11826eb01 by Victor Stinner in branch 'master': bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043) https://github.com/python/cpython/commit/fb47bca9ee2d07ce96df94b4e4abafd11826eb01 --

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread STINNER Victor
STINNER Victor added the comment: I created bpo-34170: "Py_Initialize(): computing path configuration must not have side effect (PEP 432)" as a follow-up of this issue. -- ___ Python tracker

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread Nick Coghlan
Nick Coghlan added the comment: +1 from me for the idea of fixing Python 3.7 to correctly set sys.argv in this case (and leaving everything else unmodified). As far as further enhancement in Python 3.8 goes, perhaps that can be seen as part of PEP 432, such that embedding applications have

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread STINNER Victor
STINNER Victor added the comment: I looked one more time at Python 3.6, code before my huge Py_Main()/Py_Initialize() refactoring, before _PyCoreConfig/_PyMainInterpreterConfig have been added. In short, calling Py_Main() after Py_Initialize() "works" in Python 3.6 but only sys.argv is set:

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-20 Thread STINNER Victor
STINNER Victor added the comment: > This hits fontforge. See https://bugzilla.redhat.com/show_bug.cgi?id=1595421 Copy of my comment 20: I looked one more time to the issue: * fontforge code is fine: it calls Py_Initialize() before using the Python C API to initialize its Python namespace

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-12 Thread STINNER Victor
STINNER Victor added the comment: I tested fontforge. It became clear to me that the fontforge must be able to call Py_Initialize() and only later call Py_Main(). fontforge calls Py_Initialize() and then uses the Python API: /* This is called to start up the embedded python interpreter */

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-10 Thread Nick Coghlan
Nick Coghlan added the comment: Thinking about this some more, I'm inclined to go the same way we did with issue 33932: classify it as an outright regression, work out the desired requirements for a missing embedding test case, and then fix the implementation to pass the new test case. My

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-04 Thread Alexander Belopolsky
Change by Alexander Belopolsky : -- nosy: +belopolsky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-04 Thread Nick Coghlan
Nick Coghlan added the comment: Aye, and I think from Miro's comments on your PR, making it apply some of the same configuration settings that 3.6 and earlier applied is going to be required to get fontforge working again for 3.7. At the very least, the call to set sys.argv is needed.

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-02 Thread Matej Cepl
Change by Matej Cepl : -- nosy: +mcepl ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-02 Thread STINNER Victor
STINNER Victor added the comment: My PR 8043 fix the Python 3.7 regression: allow again to call Py_Main() after Py_Initialize(). Nick: if you want to raise an error on that case, I would prefer to see a deprecation warning emitted in version N before raising an error in version N+1.

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-07-02 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +7652 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Nick Coghlan
Nick Coghlan added the comment: Removing 3.6 from the affected versions, since we re-arranged these docs a bit for 3.7 to make it clearer which functions could be called prior to initialization, as well as adding more tests for the actual pre-init functionality. Since 3.6 isn't going to

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Nick Coghlan
Change by Nick Coghlan : -- keywords: +patch pull_requests: +7632 stage: test needed -> patch review ___ Python tracker ___ ___

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Nick Coghlan
Nick Coghlan added the comment: At the very least, I think this calls for a documentation change, such that we make it clear that: 1. The expected calling pattern is to call Py_Main() *instead of* Py_Initialize(), since Py_Main() calls Py_Initialize(). 2. If you do call Py_Initialize()

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I've asked Miro to try essentially that in https://bugzilla.redhat.com/show_bug.cgi?id=1595421#c12 My concern is that Py_Main used to keep a *lot* of state on the local C stack that we've now moved into the main interpreter config. So my suspicion is

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread STINNER Victor
STINNER Victor added the comment: Even if it's ugly, calling Py_Main() after Py_Initialize() works in Python 3.6 by ignoring the new config of Py_Main(). I suggest to do nothing (just return) when Py_Initialize() is called again by Py_Main() in Python 3.7. It would fix the fontforge

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Nick Coghlan
Change by Nick Coghlan : -- nosy: +emilyemorehouse ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Miro Hrončok
Miro Hrončok added the comment: This hits fontforge. See https://bugzilla.redhat.com/show_bug.cgi?id=1595421 An example of how it should be handled there if 3) is selected would be greatly appreciated. Thanks -- nosy: +hroncok ___ Python tracker

[issue34008] Do we support calling Py_Main() after Py_Initialize()?

2018-06-30 Thread Nick Coghlan
New submission from Nick Coghlan : In the current documentation, Py_Main is listed as a regular C API function: https://docs.python.org/3/c-api/veryhigh.html#c.Py_Main We also didn't add Py_Main() to https://docs.python.org/3/c-api/init.html#before-python-initialization when we did the