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 c2621566
Recipients c2621566
Date 2014-12-30.19:10:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1419966631.84.0.639997296504.issue23135@psf.upfronthosting.co.za>
In-reply-to
Content
This patch allows specifying import searchpaths as `-p path` arguments to the interpreter, without touching environment variables.

Avoiding environment variables simplifies a script of mine and is a portable way of swapping module implementation without touching the importing script.

e.g.
# python -p ~/.bin/customlib -p ~/.bin/other script.py
is equivalent to
# PYTHONPATH=~/.bin/customlib:~/.bin/other:$PYTHONPATH python script.py
similarly to
# ghci -i.bin/customlib:.bin/other foo.hs

It is implemented by prepending the arguments to sys.path in Py_Main just after Py_Initialize is called.
History
Date User Action Args
2014-12-30 19:10:31c2621566setrecipients: + c2621566
2014-12-30 19:10:31c2621566setmessageid: <1419966631.84.0.639997296504.issue23135@psf.upfronthosting.co.za>
2014-12-30 19:10:31c2621566linkissue23135 messages
2014-12-30 19:10:31c2621566create