Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting call trace while executing "modules spam" at help prompt #51264

Closed
rishikesh mannequin opened this issue Sep 29, 2009 · 7 comments
Closed

Getting call trace while executing "modules spam" at help prompt #51264

rishikesh mannequin opened this issue Sep 29, 2009 · 7 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@rishikesh
Copy link
Mannequin

rishikesh mannequin commented Sep 29, 2009

BPO 7015
Nosy @birkenfeld, @pitrou, @ned-deily, @merwok, @bitdancer
Superseder
  • bpo-7425: Improve the robustness of "pydoc -k" in the face of broken modules
  • Files
  • pkgutil.py.patch: pkgutil.py resistance against modules errors.
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2011-06-09.16:11:27.393>
    created_at = <Date 2009-09-29.06:38:07.097>
    labels = ['type-bug', 'library']
    title = 'Getting call trace while executing "modules spam" at help prompt'
    updated_at = <Date 2011-10-07.07:10:20.973>
    user = 'https://bugs.python.org/rishikesh'

    bugs.python.org fields:

    activity = <Date 2011-10-07.07:10:20.973>
    actor = 'ned.deily'
    assignee = 'none'
    closed = True
    closed_date = <Date 2011-06-09.16:11:27.393>
    closer = 'eric.araujo'
    components = ['Library (Lib)']
    creation = <Date 2009-09-29.06:38:07.097>
    creator = 'rishikesh'
    dependencies = []
    files = ['15007']
    hgrepos = []
    issue_num = 7015
    keywords = ['patch']
    message_count = 7.0
    messages = ['93253', '93282', '93361', '93366', '93377', '137999', '145059']
    nosy_count = 7.0
    nosy_names = ['georg.brandl', 'pitrou', 'ned.deily', 'eric.araujo', 'r.david.murray', 'rishikesh', 'jankratochvil']
    pr_nums = []
    priority = 'low'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '7425'
    type = 'behavior'
    url = 'https://bugs.python.org/issue7015'
    versions = ['Python 2.6']

    @rishikesh
    Copy link
    Mannequin Author

    rishikesh mannequin commented Sep 29, 2009

    [root@ ~]# python
    Python 2.6.2 (r262:71600, Aug 21 2009, 12:23:57) 
    [GCC 4.4.1 20090818 (Red Hat 4.4.1-6)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> help()

    Welcome to Python 2.6! This is the online help utility.

    If this is your first time using Python, you should definitely check out
    the tutorial on the Internet at http://docs.python.org/tutorial/.

    Enter the name of any module, keyword, or topic to get help on writing
    Python programs and using Python modules. To quit this help utility and
    return to the interpreter, just type "quit".

    To get a list of available modules, keywords, or topics, type "modules",
    "keywords", or "topics". Each module also comes with a one-line summary
    of what it does; to list the modules whose summaries contain a given word
    such as "spam", type "modules spam".

    help> modules spam

    Here is a list of matching modules. Enter any module name to get more help.

    ** (.:18352): WARNING **: Trying to register gtype 'WnckWindowState' as
    flags when in fact it is of type 'GEnum'

    ** (.:18352): WARNING **: Trying to register gtype 'WnckWindowActions'
    as flags when in fact it is of type 'GEnum'

    ** (.:18352): WARNING **: Trying to register gtype
    'WnckWindowMoveResizeMask' as flags when in fact it is of type 'GEnum'
    Adding pauses to default speech formatting strings.
    Adding pauses to Gecko speech formatting strings.
    Adding pauses to soffice speech formatting strings.
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib64/python2.6/site.py", line 433, in __call__
        return pydoc.help(*args, **kwds)
      File "/usr/lib64/python2.6/pydoc.py", line 1720, in __call__
        self.interact()
      File "/usr/lib64/python2.6/pydoc.py", line 1738, in interact
        self.help(request)
      File "/usr/lib64/python2.6/pydoc.py", line 1757, in help
        self.listmodules(split(request)[1])
      File "/usr/lib64/python2.6/pydoc.py", line 1862, in listmodules
        apropos(key)
      File "/usr/lib64/python2.6/pydoc.py", line 1962, in apropos
        ModuleScanner().run(callback, key)
      File "/usr/lib64/python2.6/pydoc.py", line 1927, in run
        for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror):
      File "/usr/lib64/python2.6/pkgutil.py", line 110, in walk_packages
        __import__(name)
      File "/usr/lib/python2.6/site-packages/gdb/__init__.py", line 19, in
    <module>
        import gdb.command.require
      File "/usr/lib/python2.6/site-packages/gdb/command/require.py", line
    21, in <module>
        class RequireCommand (gdb.Command):
    AttributeError: 'module' object has no attribute 'Command'
    >>>

    @rishikesh rishikesh mannequin assigned birkenfeld Sep 29, 2009
    @rishikesh rishikesh mannequin added type-crash A hard crash of the interpreter, possibly with a core dump docs Documentation in the Doc dir labels Sep 29, 2009
    @pitrou
    Copy link
    Member

    pitrou commented Sep 29, 2009

    It's a problem with one of your installed modules. I don't think Python
    can do anything, unless you propose silencing all errors.

    @jankratochvil
    Copy link
    Mannequin

    jankratochvil mannequin commented Sep 30, 2009

    This patch will make the modules' command succeeed. Later requesting the specific gdb' module will cause:

    help> gdb
    problem in gdb - <type 'exceptions.AttributeError'>: 'module' object has
    no attribute 'Command'

    I think this is right in general, a single broken module should not
    abort the whole modules traversal.

    Another issues is why the gdb' module fails: It expects the bindings inside the native /usr/bin/gdb' process to exist. Should it just
    silently skip its functions if no /usr/bin/gdb' binding is found? Or should these gdb modules be located outside of /usr/lib*/python2.x'?
    There are already some glue python modules
    in `/usr/share/gdb/auto-load/'. Thanks for advice.

    @bitdancer
    Copy link
    Member

    It may well be possible to improve the handling of exceptions (I haven't
    looked at your patch yet), but fixing gdb, or rather the python bindings
    for it, are out of the scope of this bug tracker since it is third-party
    code.

    @bitdancer bitdancer added stdlib Python modules in the Lib dir and removed docs Documentation in the Doc dir labels Sep 30, 2009
    @bitdancer bitdancer added type-bug An unexpected behavior, bug, or error and removed type-crash A hard crash of the interpreter, possibly with a core dump labels Sep 30, 2009
    @jankratochvil
    Copy link
    Mannequin

    jankratochvil mannequin commented Sep 30, 2009

    The python bindings were therefore fixed downstream:
    gdb-6.8.91.20090930-2.fc12
    http://koji.fedoraproject.org/koji/buildinfo?buildID=134595

    @merwok
    Copy link
    Member

    merwok commented Jun 9, 2011

    Looks like this is an external bug.

    @merwok merwok added the invalid label Jun 9, 2011
    @merwok merwok closed this as completed Jun 9, 2011
    @ned-deily
    Copy link
    Member

    The problem of pydoc apropos failing due to exceptions raised by pkgutil walk_packages is fixed in 2.7.3 by the changes for bpo-7425; they were already fixed in 3.x.

    @ned-deily ned-deily removed the invalid label Oct 7, 2011
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    5 participants