Re: [RFA] ignore PYTHONHOME environment variable.

Jan Kratochvil
2010-11-23T03:01:10Z

On Tue, 23 Nov 2010 02:03:22 +0100, Joel Brobecker wrote:
> This is something I hinted during one of our discussion at this year's
> GCC Summit.
>
> If PYTHONHOME is defined in the environment, then Py_SetProgramName
> does not use the program-name location to find the python library.
> Instead, it follows the PYTHONHOME, which can cause problems if
> it points to a different Python installation, particularly if that
> installation is from a different version of Python.

On standard Fedora 14 ./configure (no python options given) I get:
#define HAVE_LIBPYTHON2_7 1
#define HAVE_PYTHON 1
#define PYTHON_PATH_RELOCATABLE 0
#define WITH_PYTHON_PATH "/usr"

I am not a Python expect but I believe for GDB linked with the only regular
system Python $PYTHONHOME should work, even for GDB-Python.

Maybe it should be overriden only for the case of PYTHON_PATH_RELOCATABLE?
Or maybe only if --with-python=SPECIFIC-PATH has been given?

(I do not have an opinion what it should do in such case, just I think I know
what it should do in the default system Python case.)

Thanks,
Jan