This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug python/22503] New: GDB uses PYTHONHOME environment variable, but can't find the correct python environment.


https://sourceware.org/bugzilla/show_bug.cgi?id=22503

            Bug ID: 22503
           Summary: GDB uses PYTHONHOME environment variable, but can't
                    find the correct python environment.
           Product: gdb
           Version: 7.6
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: pflarr at gmail dot com
  Target Milestone: ---

When running gdb with PYTHONHOME set to a custom python environment, gdb seems
to use that python but can't find the correct environment. The result, as
typical when python can't find its environment, is for python to fail on trying
to import the site module, giving the following error:
ImportError: No module named site

This appears to apply to all versions of gdb with python support.

The workaround is to run gdb with PYTHONHOME forced to the system python, such
as `$ PYTHONHOME=/usr gdb`. This isn't really good enough for us though, as
having non-system PYTHONHOME set is standard in our user build environments.

My guess at the fix is for gdb to ignore PYTHONHOME (and probably PYTHONPATH),
and always use the python it was built against. The python command line
provides a -E option to do exactly that, or you can unsetenv on PYTHONHOME
within gdb.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]