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 course progpath = prog So it uses the host process name from step 2 (i.e. progpath) whenever Py_SetProgramName() has not been used and step 3 has set prog to a value not containing a directory separator (or if it *has* been used to set something with no such separator in it). The logic makes sense, I think, but it is quite impenetrable. Any chance of PEP 432 ("Restructuring the CPython startup sequence") happening this century? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue31349> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com