#101 find_base raises unexpected AttributeError

v3.0
closed-fixed
Edward Loper
5
2006-08-21
2006-05-31
No

In
epydoc-3.0alpha2-1,
recompiled from src.rpm, on an X86_64,
while trying to create docs for PyXML (_xmlplus),
I get a repeatable early error in

docparser.py, function find_base() at the line
if (lookup_name(name[0], parent_docs).imported_from not
in (None, UNKNOWN)):

The problem is that lookup_name can return a None, and a
resulting error message
'NoneType' object has no attribute 'imported_from'
is understandable (but not handled -- yielding an abort).

If it matters, the error occurs while trying to process
drv_sgmlop_html.py line 13. The class SaxParser is defined
in drv_sgmlop.py in the same (drivers2) directory, which
comes from PyXML-0.8.4-3.

The caller to find_base is evidently
process_classdef
which is working on the data:
bases([(51, u'('), (1, u'SaxParser'), (51, u')')])=..
[DottedName(u'SaxParser')]
The full line, being
[(1, u'class'), (1, u'SaxHtmlParser'), [(51, u'('), (1,
u'SaxParser'), (51, u')')], (51, u':')]

Regards,
..jim

Discussion

  • David Harvey
    David Harvey
    2006-06-17

    Logged In: YES
    user_id=1313814

    I'm getting this error too. The simplest input I found that generates it seems to
    be the following:

    ========== begin

    class A(B):
    pass

    ========== end

     
  • Edward Loper
    Edward Loper
    2006-08-21

    • status: open --> closed-fixed
     
  • Edward Loper
    Edward Loper
    2006-08-21

    Logged In: YES
    user_id=195958

    Thanks for the bug report.

    This should be fixed in the latest subversion revision.