[issue23135] import searchpaths as arguments

2014-12-31 Thread c2621566

c2621566 added the comment:

Thanks for the feedback. The technical arguments convinced me not to spend more 
time on this. I admit this patch is kind of an ugly hack. The effort needed for 
a technically satisfactory solution seems too much for this unimportant feature.

--
resolution:  -> rejected
status: open -> closed

___
Python tracker 
<http://bugs.python.org/issue23135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23135] import searchpaths as arguments

2014-12-30 Thread c2621566

New submission from c2621566:

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.

--
components: Interpreter Core
files: main.c.searchpatharg1.diff
keywords: patch
messages: 233216
nosy: c2621566
priority: normal
severity: normal
status: open
title: import searchpaths as arguments
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file37567/main.c.searchpatharg1.diff

___
Python tracker 
<http://bugs.python.org/issue23135>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com