public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug python/25826] New: Handle verbose python initialization problems
@ 2020-04-15 13:35 vries at gcc dot gnu.org
  2020-04-15 13:48 ` [Bug python/25826] " vries at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-15 13:35 UTC (permalink / raw)
  To: gdb-prs

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

            Bug ID: 25826
           Summary: Handle verbose python initialization problems
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: python
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

Say my gdb is built against system python, and somehow I've managed to install
a site package that gives me trouble:
...
$ cat /usr/lib/python3.6/site-packages/Paste-3.4.0-py2.7-nspkg.pth
import sys, types, os;raise NameError('HiThere')
...
so when I run python, I see:
...
$ /usr/bin/python3.6
Error processing line 1 of
/usr/lib/python3.6/site-packages/Paste-3.4.0-py2.7-nspkg.pth:

  Traceback (most recent call last):
    File "/usr/lib64/python3.6/site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  NameError: HiThere

Remainder of file ignored
Python 3.6.10 (default, Jan 16 2020, 09:12:04) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
...
and likewise, when I run gdb:
...
$ gdb -q
Error processing line 1 of
/usr/lib/python3.6/site-packages/Paste-3.4.0-py2.7-nspkg.pth:

  Traceback (most recent call last):
    File "/usr/lib64/python3.6/site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  NameError: HiThere

Remainder of file ignored
(gdb) 
...

It would be nice if we could do something about this in gdb, like:
- disable python if any output occurs during initialization (which is
  perhaps a bit harsh), or
- dress up the output a bit to clarify the situation.

F.i., the latter could be something like this:
...
$ gdb -q
Warning: Python initialization succeeded, but with output (does python
installation need fixing?):
<start of python initialization output>
Error processing line 1 of
/usr/lib/python3.6/site-packages/Paste-3.4.0-py2.7-nspkg.pth:

  Traceback (most recent call last):
    File "/usr/lib64/python3.6/site.py", line 168, in addpackage
      exec(line)
    File "<string>", line 1, in <module>
  NameError: HiThere

Remainder of file ignored
<end of python initialization output>
(gdb)
...

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug python/25826] Handle verbose python initialization problems
  2020-04-15 13:35 [Bug python/25826] New: Handle verbose python initialization problems vries at gcc dot gnu.org
@ 2020-04-15 13:48 ` vries at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: vries at gcc dot gnu.org @ 2020-04-15 13:48 UTC (permalink / raw)
  To: gdb-prs

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

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
(In reply to Tom de Vries from comment #0)

> <start of python initialization output>
> Error processing line 1 of
> /usr/lib/python3.6/site-packages/Paste-3.4.0-py2.7-nspkg.pth:
> 
>   Traceback (most recent call last):
>     File "/usr/lib64/python3.6/site.py", line 168, in addpackage
>       exec(line)
>     File "<string>", line 1, in <module>
>   NameError: HiThere
> 
> Remainder of file ignored
> <end of python initialization output>

or:
...
python initialization output available in temp file
/tmp/gdb-python-init.XXXXXX.log
...

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-04-15 13:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-15 13:35 [Bug python/25826] New: Handle verbose python initialization problems vries at gcc dot gnu.org
2020-04-15 13:48 ` [Bug python/25826] " vries at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).