This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author chrullrich
Recipients chrullrich, paul.moore, steve.dower, tim.golden, zach.ware
Date 2017-09-05.18:08:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1504634886.22.0.658858777734.issue31349@psf.upfronthosting.co.za>
In-reply-to
Content
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?
History
Date User Action Args
2017-09-05 18:08:06chrullrichsetrecipients: + chrullrich, paul.moore, tim.golden, zach.ware, steve.dower
2017-09-05 18:08:06chrullrichsetmessageid: <1504634886.22.0.658858777734.issue31349@psf.upfronthosting.co.za>
2017-09-05 18:08:06chrullrichlinkissue31349 messages
2017-09-05 18:08:06chrullrichcreate