[issue31349] Embedded initialization ignores Py_SetProgramName()

2019-09-25 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue31349] Embedded initialization ignores Py_SetProgramName()

2019-09-25 Thread STINNER Victor
STINNER Victor added the comment: Modules/getpath.c and PC/getpathp.c have been deeply reworked with the implementation of the PEP 587 in Python 3.8. Parameters which are already set (ex: Py_SetProgramName() or using the new PyConfig API) are no longer overriden. I added some tests on the

[issue31349] Embedded initialization ignores Py_SetProgramName()

2018-03-06 Thread Steve Dower
Steve Dower added the comment: (That said, I didn't try again 3.7, so it may already be fixed there. But since we're still fixing problems with 3.6, we should do that one too.) -- ___ Python tracker

[issue31349] Embedded initialization ignores Py_SetProgramName()

2018-03-06 Thread Steve Dower
Steve Dower added the comment: I just hit this myself (and embarrassingly, I recently touched this code everyone and forgot to fix this). Hopefully I get a chance to get to it, but patches are certainly welcome and I'll happily aim to get them into 3.6 onwards.

[issue31349] Embedded initialization ignores Py_SetProgramName()

2017-09-05 Thread Steve Dower
Steve Dower added the comment: People are working on PEP 432 this week at the sprints, so yeah, it's likely. -- ___ Python tracker ___

[issue31349] Embedded initialization ignores Py_SetProgramName()

2017-09-05 Thread Christian Ullrich
Christian Ullrich added the comment: Not quite. Looking a bit further down get_progname()'s weird logic, we see that it works like this: 1. prog = Py_GetProgramName() 2. progpath = GetModuleFileNameW() 3. if (prog is empty): prog = "python" 4. if (slash in prog): # Or backslash, of

[issue31349] Embedded initialization ignores Py_SetProgramName()

2017-09-05 Thread Steve Dower
Steve Dower added the comment: You're right, though I disagree with the fix as that would cause the process filename to be ignored. A correct fix would check whether the name has been set explicitly and if so, either use it as-is (if absolute) or get the actual name and use its directory

[issue31349] Embedded initialization ignores Py_SetProgramName()

2017-09-05 Thread Christian Ullrich
Christian Ullrich added the comment: That should have been diff --git a/PC/getpathp.c b/PC/getpathp.c index e7be704a9a..abb5e54c9f 100644 --- a/PC/getpathp.c +++ b/PC/getpathp.c @@ -443,8 +443,7 @@ get_progpath(void) #else dllpath[0] = 0; #endif -if (GetModuleFileNameW(NULL,

[issue31349] Embedded initialization ignores Py_SetProgramName()

2017-09-05 Thread Christian Ullrich
New submission from Christian Ullrich: I'm trying to do something that may be slightly tricky, and I think I just found a vintage 1997 bug. Please correct me if I'm wrong. This is PC/getpathp.c from current master: 430: static void 431: get_progpath(void) 432: { 433: extern wchar_t