breaks on some attributes

Landreville avatarLandreville created an issue

sphinx-build with autodoc now fails on some attributes. I am using autodoc for a project that includes SQLAlchemy models. Previously str() was called on SQLAlchemy's Relationship attributes. Now repr() is being called (as introduced in this commit ). I think this is happening when autodoc is skipping a member, but repr is now called when logging that it is skipping that member.

The following stack trace occurs during sphinx-build:

Traceback (most recent call last):
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/cmdline.py", line 247, in main
    app.build(force_all, filenames)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/application.py", line 211, in build
    self.builder.build_update()
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/builders/__init__.py", line 211, in build_update
    'out of date' % len(to_build))
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/builders/__init__.py", line 231, in build
    purple, length):
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/builders/__init__.py", line 131, in status_iterator
    for item in iterable:
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/environment.py", line 458, in update_generator
    self.read_doc(docname, app=app)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/environment.py", line 606, in read_doc
    pub.publish()
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/core.py", line 217, in publish
    self.settings)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/readers/__init__.py", line 72, in read
    self.parse()
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/__init__.py", line 172, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 174, in run
    input_source=document['source'])
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 2706, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 331, in section
    self.new_subsection(title, lineno, messages)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 399, in new_subsection
    node=section_node, match_titles=True)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 286, in nested_parse
    node=node, match_titles=match_titles)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 199, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 2706, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 331, in section
    self.new_subsection(title, lineno, messages)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 399, in new_subsection
    node=section_node, match_titles=True)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 286, in nested_parse
    node=node, match_titles=match_titles)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 199, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 2279, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 2291, in explicit_construct
    return method(self, expmatch)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 2034, in directive
    directive_class, match, type_name, option_presets)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/docutils-0.10-py2.7.egg/docutils/parsers/rst/states.py", line 2083, in run_directive
    result = directive_instance.run()
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 1346, in run
    documenter.generate(more_content=self.content)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 755, in generate
    self.document_members(all_members)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 679, in document_members
    check_module=members_check_module and not isattr)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 755, in generate
    self.document_members(all_members)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 1087, in document_members
    ModuleLevelDocumenter.document_members(self, all_members)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 648, in document_members
    for (mname, member, isattr) in self.filter_members(members, want_all):
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/ext/autodoc.py", line 616, in filter_members
    not keep, self.options)
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/application.py", line 357, in emit_firstresult
    for result in self.emit(event, *args):
  File "/home/ci/venv/ci/lib/python2.7/site-packages/Sphinx-1.2b1-py2.7.egg/sphinx/application.py", line 349, in emit
    self.debug2('[app] emitting event: %r%s', event, repr(args)[:100])
  File "build/bdist.linux-x86_64/egg/sqlalchemy/orm/interfaces.py", line 292, in __repr__
    id(self), self.key)
AttributeError: 'RelationshipProperty' object has no attribute 'key'

Comments (1)

  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.