nicolashainaux / sphinx-autodoc-annotation

Use Python 3 annotations in sphinx-enabled docstrings
BSD 3-Clause "New" or "Revised" License
43 stars 5 forks source link

Plugin crashes when I try to use it #2

Closed ismail-s closed 8 years ago

ismail-s commented 8 years ago

Traceback:

Exception occurred:
  File "/usr/local/lib/python3.4/dist-packages/sphinx_autodoc_annotation.py", line 65, in get_doc
    add_annotation_content(self.object, result[-1])
IndexError: list index out of range
The full traceback has been saved in /tmp/sphinx-err-c6hpws9t.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
make: *** [html] Error 1

Here is the contents of that log file:

# Sphinx version: 1.3.1
# Python version: 3.4.0 (CPython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
# Last messages:
#   Running Sphinx v1.3.1
#   loading pickled environment...
#   done
#   building [mo]: targets for 0 po files that are out of date
#   building [html]: targets for 0 source files that are out of date
#   updating environment:
#   [extensions changed] 4 added, 0 changed, 0 removed
#   reading sources... [ 25%] fireblog
# Loaded extensions:
#   alabaster (0.7.6) from /usr/local/lib/python3.4/dist-packages/alabaster/__init__.py
#   sphinx_autodoc_annotation (unknown version) from /usr/local/lib/python3.4/dist-packages/sphinx_autodoc_annotation.py
#   sphinx.ext.todo (1.3.1) from /usr/local/lib/python3.4/dist-packages/sphinx/ext/todo.py
#   sphinx.ext.coverage (1.3.1) from /usr/local/lib/python3.4/dist-packages/sphinx/ext/coverage.py
#   sphinx.ext.viewcode (1.3.1) from /usr/local/lib/python3.4/dist-packages/sphinx/ext/viewcode.py
#   sphinx.ext.autodoc (1.3.1) from /usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py
Traceback (most recent call last):
  File "/usr/local/lib/python3.4/dist-packages/sphinx/cmdline.py", line 245, in main
    app.build(opts.force_all, filenames)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/application.py", line 264, in build
    self.builder.build_update()
  File "/usr/local/lib/python3.4/dist-packages/sphinx/builders/__init__.py", line 245, in build_update
    'out of date' % len(to_build))
  File "/usr/local/lib/python3.4/dist-packages/sphinx/builders/__init__.py", line 259, in build
    self.doctreedir, self.app))
  File "/usr/local/lib/python3.4/dist-packages/sphinx/environment.py", line 618, in update
    self._read_serial(docnames, app)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/environment.py", line 638, in _read_serial
    self.read_doc(docname, app)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/environment.py", line 791, in read_doc
    pub.publish()
  File "/usr/local/lib/python3.4/dist-packages/docutils/core.py", line 217, in publish
    self.settings)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/environment.py", line 126, in read
    self.parse()
  File "/usr/local/lib/python3.4/dist-packages/docutils/readers/__init__.py", line 78, in parse
    self.parser.parse(self.input, document)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/__init__.py", line 172, in parse
    self.statemachine.run(inputlines, document, inliner=self.inliner)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 170, in run
    input_source=document['source'])
  File "/usr/local/lib/python3.4/dist-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.4/dist-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 2726, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.4/dist-packages/docutils/statemachine.py", line 239, in run
    context, state, transitions)
  File "/usr/local/lib/python3.4/dist-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 2726, in underline
    self.section(title, source, style, lineno - 1, messages)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 327, in section
    self.new_subsection(title, lineno, messages)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 395, in new_subsection
    node=section_node, match_titles=True)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 282, in nested_parse
    node=node, match_titles=match_titles)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 195, in run
    results = StateMachineWS.run(self, input_lines, input_offset)
  File "/usr/local/lib/python3.4/dist-packages/docutils/statemachine.py", line 239, in run
     context, state, transitions)
  File "/usr/local/lib/python3.4/dist-packages/docutils/statemachine.py", line 460, in check_line
    return method(match, context, next_state)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 2299, in explicit_markup
    nodelist, blank_finish = self.explicit_construct(match)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 2311, in explicit_construct
    return method(self, expmatch)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 2054, in directive
    directive_class, match, type_name, option_presets)
  File "/usr/local/lib/python3.4/dist-packages/docutils/parsers/rst/states.py", line 2103, in run_directive
    result = directive_instance.run()
  File "/usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py", line 1467, in run
    documenter.generate(more_content=self.content)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py", line 828, in generate
    self.document_members(all_members)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py", line 750, in document_members
    check_module=members_check_module and not isattr)
  File "/usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py", line 815, in generate
    sig = self.format_signature()
  File "/usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py", line 1008, in format_signature
    result = self._find_signature()
  File "/usr/local/lib/python3.4/dist-packages/sphinx/ext/autodoc.py", line 971, in _find_signature
    docstrings = self.get_doc(encoding)
  File "/usr/local/lib/python3.4/dist-packages/sphinx_autodoc_annotation.py", line 65, in get_doc
    add_annotation_content(self.object, result[-1])
IndexError: list index out of range    
jsbueno commented 8 years ago

The code on this repository actually fixes that already - but there was no release after the fix. https://github.com/nicolashainaux/sphinx-autodoc-annotation/commit/2210fd86f7b650c7cc5bb8cb0c273643a563360a

ismail-s commented 8 years ago

Then in that case, #5 should fix this, whenever @nicolashainaux sorts that out.

nicolashainaux commented 8 years ago

I just published the patched version on PyPI, so this should be solved now.