Issue 7180: "pydoc -k" can generate AttributeError on Mac OS X (original) (raw)

Running "pydoc -k ..." with a query string will end with a Python AttributeError while looking for Carbon.File.FSSpecType.

I was using /usr/bin/pydoc on Mac OS X Snow Leopard, which is from Python 2.6.1.

It appears that any query will produce a similar error, but here is one case:

% pydoc -k example xxsubtype - xxsubtype is an example module showing how to subtype builtin types from C. doctest - Module doctest -- a framework for running examples in docstrings. Traceback (most recent call last): File "/usr/bin/pydoc2.6", line 7, in pydoc.cli() File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pydoc.py", line 2216, in cli apropos(val) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pydoc.py", line 1911, in apropos ModuleScanner().run(callback, key) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pydoc.py", line 1876, in run for importer, modname, ispkg in pkgutil.walk_packages(onerror=onerror): File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/pkgutil.py", line 110, in walk_packages import(name) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/lib- scriptpackages/CodeWarrior/init.py", line 8, in import aetools File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/aetools.py", line 36, in from aepack import packkey, pack, unpack, coerce, AEDescType File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/aepack.py", line 61, in FSSType = Carbon.File.FSSpecType AttributeError: 'module' object has no attribute 'FSSpecType'

A solution would appear to be as follows:

Since Carbon.File no longer defines FSSpecType, perhaps aepack.py should no longer support it. This would require removing the definition from aepack.py:61, as well as the case in the pack() routine (at aepack.py:88-89) that uses FSSType.