Message301346
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? |
|
Date |
User |
Action |
Args |
2017-09-05 18:08:06 | chrullrich | set | recipients:
+ chrullrich, paul.moore, tim.golden, zach.ware, steve.dower |
2017-09-05 18:08:06 | chrullrich | set | messageid: <1504634886.22.0.658858777734.issue31349@psf.upfronthosting.co.za> |
2017-09-05 18:08:06 | chrullrich | link | issue31349 messages |
2017-09-05 18:08:06 | chrullrich | create | |
|