➜

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.

作者 chrullrich
收信人 chrullrich, paul.moore, steve.dower, tim.golden, zach.ware
日期 2017-09-05.18:08:06
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1504634886.22.0.658858777734.issue31349@psf.upfronthosting.co.za>
In-reply-to
内容
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?
历史
日期 用户 动作 参数
2017-09-05 18:08:06chrullrich修改recipients: + chrullrich, paul.moore, tim.golden, zach.ware, steve.dower
2017-09-05 18:08:06chrullrich修改messageid: <1504634886.22.0.658858777734.issue31349@psf.upfronthosting.co.za>
2017-09-05 18:08:06chrullrich链接issue31349 messages
2017-09-05 18:08:06chrullrich创建