This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: "pydoc -k" can generate AttributeError on Mac OS X
Type: behavior Stage:
Components: macOS Versions: Python 2.6
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: ronaldoussoren Nosy List: kmgrant, ronaldoussoren
Priority: normal Keywords:

Created on 2009-10-21 06:43 by kmgrant, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg94307 - (view) Author: Kevin Grant (kmgrant) Date: 2009-10-21 06:43
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 <module>
      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 <module>
      import aetools
    File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/plat-mac/aetools.py", line 36, in <module>
      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 <module>
      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.
msg95501 - (view) Author: Ronald Oussoren (ronaldoussoren) * (Python committer) Date: 2009-11-19 17:40
The problem occurs in two occassions:

1) python was configured/built without the Carbon bindings (such
  as the copy that Apple ships)

2) python was build in 64-bit mode

In both cases Carbon.File does not have an FSSpec type.

Luckily this has already been fixed (r74681 in the 2.6 branch, and an 
earlier revision on the trunk).  The fix is in 2.6.4.
History
Date User Action Args
2022-04-11 14:56:54adminsetgithub: 51429
2009-11-19 17:40:58ronaldoussorensetstatus: open -> closed
resolution: accepted
messages: + msg95501
2009-10-21 06:43:15kmgrantcreate