Re: [RFA] ignore PYTHONHOME environment variable.

Doug Evans
2010-11-23T09:29:18Z

On Mon, Nov 22, 2010 at 7:00 PM, Jan Kratochvil
<jan.kratochvil@redhat.com> wrote:
> 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.)

Hi.
I'm not sure I understand the objection.
AIUI, if gdb is linked with the system python then Joel's patch is
essentially a nop
(i.e. PYTHONHOME=/usr would still work).

[Right?]