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 kristjan.jonsson
Recipients kristjan.jonsson
Date 2010-09-21.06:32:28
SpamBayes Score 3.4469514e-09
Marked as misclassified No
Message-id <1285050754.57.0.81319423251.issue9910@psf.upfronthosting.co.za>
In-reply-to
Content
When calling Py_Initialize() from an embedding application, there is currently no way for the application to override Python's initial settin g of sys.path.  An elaborate mechanism in getpathp.c kicks in, guessing the path based on several criteria.

Ideally, this mechanism, which is valid only for python.exe and its semantics, should be opt in.  It forces embedders that have their own libraries to go through complicated hoops (with environment variables and what not) to direct their embedded interpreter at the right place for modules, and to make sure that it is not confused by any other python distribution present on the system.

This submission adds a Py_SetPath() function to the API.  This has been successfully used by CCP in EVE Online and other products to completely override python's path guessing mechanics.  If called with a semicolon separated path prior to Py_Initialize, it will be used as the fodder for the initial sys.path.
History
Date User Action Args
2010-09-21 06:32:34kristjan.jonssonsetrecipients: + kristjan.jonsson
2010-09-21 06:32:34kristjan.jonssonsetmessageid: <1285050754.57.0.81319423251.issue9910@psf.upfronthosting.co.za>
2010-09-21 06:32:32kristjan.jonssonlinkissue9910 messages
2010-09-21 06:32:31kristjan.jonssoncreate