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 ncoghlan
Recipients c2621566, martin.panter, ncoghlan, r.david.murray
Date 2014-12-31.18:11:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1420049474.94.0.299634953336.issue23135@psf.upfronthosting.co.za>
In-reply-to
Content
Issue 13475 provides some additional context for discussion of changes to the sys.path initialisation process. The status quo is that I'm currently wary of adding more complexity to an already fragile initialisation sequence for things that can be implemented by way of running a custom launch script that uses the runpy module to replicate the CPython script invocation options.

In the specific case of this patch, while the idea is one we've considered before (and may end up implementing some day), this specific implementation adds new path initilisation logic directly in Py_Main, well away from getpath.c (which, in collaboration with site.py, is intended to fully handle the path initialisation logic), and without being separated out into a distinct API that embedding applications can easily take advantage of. A lot of Python code will also run *before* the command line arguments are processed, so you'll end up with a case where code run early may pick up a version of a module from later in sys.path, giving the appearance that the sys.path additions are being ignored, even though they appear in sys.path after the program is fully initialised.

While the technical concerns mean it isn't likely this particular approach would be pursued further, as a practical matter, additional things that would be needed for a patch to the interpreter argument handling to be accepted include:
- a signed contributor licensing agreement
- documentation upates in the "using" guide
- a new test (or tests) in Lib/test/test_cmdline.py and Lib/test/test_cmdline_script.py
History
Date User Action Args
2014-12-31 18:11:14ncoghlansetrecipients: + ncoghlan, r.david.murray, martin.panter, c2621566
2014-12-31 18:11:14ncoghlansetmessageid: <1420049474.94.0.299634953336.issue23135@psf.upfronthosting.co.za>
2014-12-31 18:11:14ncoghlanlinkissue23135 messages
2014-12-31 18:11:13ncoghlancreate