Export to GitHub

pyglet - issue #404

"pydoc -k" broken on GNU/Linux by pyglet


Posted on Feb 26, 2009 by Helpful Monkey

The problem can be reproduced by invoking "pydoc -k" with any keyword on a system with pyglet installed, for example: "pydoc -k rmtree"

Instead of showing the keyword search result an exception is raised because the pyglet DirectSound support code is loaded, which will obviously fail on non-Windows machines.

As this code is unlikely to be used on GNU/Linux anyways could this please not be included for builds (ie. binary) on this architecture anymore? It should be possible not exclude this module/package (and possibly others that are unused) via setuptools.

--begin error output-- $ pydoc -k rmtree Traceback (most recent call last): File "/usr/bin/pydoc", line 5, in <module> pydoc.cli() File "/usr/lib/python2.5/pydoc.py", line 2195, in cli apropos(val) File "/usr/lib/python2.5/pydoc.py", line 1890, in apropos ModuleScanner().run(callback, key) File "/usr/lib/python2.5/pydoc.py", line 1855, in run for importer, modname, ispkg in pkgutil.walk_packages(): File "/usr/lib/python2.5/pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "/usr/lib/python2.5/pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "/usr/lib/python2.5/pkgutil.py", line 125, in walk_packages for item in walk_packages(path, name+'.', onerror): File "/usr/lib/python2.5/pkgutil.py", line 110, in walk_packages import(name) File "/var/lib/python-support/python2.5/pyglet/media/drivers/directsound/init.py", line 47, in <module> from pyglet.media.drivers.directsound import lib_dsound as lib File "/var/lib/python-support/python2.5/pyglet/media/drivers/directsound/lib_dsound.py", line 39, in <module> lib = ctypes.oledll.dsound AttributeError: 'module' object has no attribute 'oledll' AL lib: ALc.c:1302: exit() 1 device(s) and 1 context(s) NOT deleted --end error output--

Comment #1

Posted on Aug 15, 2009 by Quick Lion

(No comment was entered for this change.)

Comment #2

Posted on Aug 16, 2009 by Massive Bird

I'd say that if pydoc can't handle an import failure on an unneeded module, then that's a bug in pydoc.

The suggested fix of not including Windows or OS X modules in Linux packages would be a band-aid at best: those installing from source would still have this issue. All in all, I'm not convinced that there's a problem with Pyglet here.

Comment #3

Posted on Nov 6, 2013 by Swift Elephant

Perhaps pydoc should use logiclab tools (or jedi) for static code analysis, which doesn't include/import/execute analyzed code.

Comment #4

Posted on Jan 3, 2014 by Quick Panda

I can't reproduce the problem with Python 2.7.5 and Python 3.3.2, looks like it's been fixed in pydoc:

Although to be honest pydoc is not the most reliable tool (got several segfaults with Python 2, and Python 3 version works... but after the expected result reports "pydoc3: error: no such option: -k").

I don't think this was a Pyglet bug anyway.

Status: Invalid

Labels:
OpSys-Linux