Issue #854 resolved

sphinx.ext.inheritance_diagram raises AttributeError

Hong Minhee avatarHong Minhee created an issue

It seems sphinx.ext.inheritance_diagram tries to get values of __builtins__ which is not a dict but a module.

  • Sphinx version: 1.1.2
  • Python version: 2.7.1 (actually it is PyPy 1.7.0)
  • Docutils version: 0.8.1 release
  • Jinja2 version: 2.6

I attach a traceback also:

Traceback (most recent call last):
  File "/.../site-packages/sphinx/cmdline.py", line 189, in main
    app.build(force_all, filenames)
  File "/.../site-packages/sphinx/application.py", line 204, in build
    self.builder.build_update()
  File "/.../site-packages/sphinx/builders/__init__.py", line 196, in build_update
    'out of date' % len(to_build))
  File "/.../site-packages/sphinx/builders/__init__.py", line 216, in build
    purple, length):
  File "/.../site-packages/sphinx/builders/__init__.py", line 120, in status_iterator
    for item in iterable:
  File "/.../site-packages/sphinx/environment.py", line 613, in update_generator
    self.read_doc(docname, app=app)
  File "/.../site-packages/sphinx/environment.py", line 761, in read_doc
    pub.publish()
  File "/.../site-packages/docutils/core.py", line 211, in publish
    self.settings)
  File "/.../site-packages/docutils/readers/__init__.py", line 69, in read
    self.parse()
  File "/.../site-packages/docutils/readers/__init__.py", line 75, in parse
    self.parser.parse(self.input, document)
  File "/.../site-packages/docutils/parsers/rst/__init__.py", line 157, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 170, in run
    input_source=document['source'])
  File "/.../site-packages/docutils/statemachine.py", line 237, in run
    context, state, transitions)
  File "/.../site-packages/docutils/statemachine.py", line 458, in check_line
    return method(match, context, next_state)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2283, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2295, in explicit_construct
    return method(self, expmatch)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2036, in directive
    directive_class, match, type_name, option_presets)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2087, in run_directive
    result = directive_instance.run()
  File "/.../site-packages/sphinx/ext/autodoc.py", line 1318, in run
    nested_parse_with_titles(self.state, self.result, node)
  File "/.../site-packages/sphinx/util/nodes.py", line 74, in nested_parse_with_titles
    return state.nested_parse(content, 0, node, match_titles=1)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 284, in nested_parse
    node=node, match_titles=match_titles)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/.../site-packages/docutils/statemachine.py", line 237, in run
    context, state, transitions)
  File "/.../site-packages/docutils/statemachine.py", line 458, in check_line
    return method(match, context, next_state)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2709, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 329, in section
    self.new_subsection(title, lineno, messages)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 398, in new_subsection
    node=section_node, match_titles=1)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 284, in nested_parse
    node=node, match_titles=match_titles)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/.../site-packages/docutils/statemachine.py", line 237, in run
    context, state, transitions)
  File "/.../site-packages/docutils/statemachine.py", line 458, in check_line
    return method(match, context, next_state)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2283, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2295, in explicit_construct
    return method(self, expmatch)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2036, in directive
    directive_class, match, type_name, option_presets)
  File "/.../site-packages/docutils/parsers/rst/states.py", line 2087, in run_directive
    result = directive_instance.run()
  File "/.../site-packages/sphinx/ext/inheritance_diagram.py", line 296, in run
    private_bases='private-bases' in self.options)
  File "/.../site-packages/sphinx/ext/inheritance_diagram.py", line 80, in __init__
    private_bases, parts)
  File "/.../site-packages/sphinx/ext/inheritance_diagram.py", line 145, in _class_info
    builtins = __builtins__.values()
AttributeError: 'module' object has no attribute 'values'

Comments (2)

  1. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.