Issues

Issue #832 resolved

Error when creating HTML output

Anonymous created an issue

The following stackrace is shown when I create HTML output:

{{{

Sphinx version: 1.1

Python version: 2.7.2

Docutils version: 0.8.1 release

Jinja2 version: 2.6

Traceback (most recent call last): File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\cmdline.py", line 189, in main app.build(force_all, filenames) File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\application.py", line 204, in build self.builder.build_update() File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\builders__init.py", line 196, in build_update 'out of date' % len(to_build)) File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\builders__init.py", line 216, in build purple, length): File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\builders__init.py", line 120, in status_iterator for item in iterable: File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\environment.py", line 613, in update_generator self.read_doc(docname, app=app) File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\environment.py", line 761, in read_doc pub.publish() File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\core.py", line 211, in publish self.settings) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\readers__init.py", line 69, in read self.parse() File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\readers__init.py", line 75, in parse self.parser.parse(self.input, document) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst__init.py", line 157, in parse self.statemachine.run(inputlines, document, inliner=self.inliner) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 170, in run input_source=document['source']) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\statemachine.py", line 237, in run context, state, transitions) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\statemachine.py", line 458, in check_line return method(match, context, next_state) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 2709, in underline self.section(title, source, style, lineno - 1, messages) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 329, in section self.new_subsection(title, lineno, messages) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 398, in new_subsection node=section_node, match_titles=1) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 284, in nested_parse node=node, match_titles=match_titles) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 195, in run results = StateMachineWS.run(self, input_lines, input_offset) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\statemachine.py", line 237, in run context, state, transitions) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\statemachine.py", line 458, in check_line return method(match, context, next_state) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 2283, in explicit_markup nodelist, blank_finish = self.explicit_construct(match) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 2295, in explicit_construct return method(self, expmatch) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 2036, in directive directive_class, match, type_name, option_presets) File "C:\Python27\lib\site-packages\docutils-0.8.1-py2.7.egg\docutils\parsers\rst\states.py", line 2087, in run_directive result = directive_instance.run() File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\domains__init__.py", line 190, in run return BaseDirective.run(self) File "C:\Python27\lib\site-packages\sphinx-1.1-py2.7.egg\sphinx\domains\std.py", line 308, in run self.state.nested_parse(definition, definition.items[0][1], defnode) IndexError: list index out of range

}}}

Hope this helps to tackle down this issue.

Comments (6)

  1. Eric Snow

    I got a similar error when I had something like the following at the bottom of my file:

    .. glossary:
    
       term_a
    
       term_b
    

    The problem went away once I actually wrote definitions for the different terms.

  2. qx0monster
    • changed version to 1.1
    • removed milestone

    Here seems to be another instance of this issue:

    # Sphinx version: 1.1.2
    # Python version: 2.7.1
    # Docutils version: 0.8.1 release
    # Jinja2 version: 2.6
    Traceback (most recent call last):
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/cmdline.py", line 189, in main
        app.build(force_all, filenames)
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/application.py", line 204, in build
        self.builder.build_update()
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/builders/__init__.py", line 196, in build_update
        'out of date' % len(to_build))
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/builders/__init__.py", line 216, in build
        purple, length):
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/builders/__init__.py", line 120, in status_iterator
        for item in iterable:
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/environment.py", line 613, in update_generator
        self.read_doc(docname, app=app)
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/environment.py", line 761, in read_doc
        pub.publish()
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/core.py", line 211, in publish
        self.settings)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/readers/__init__.py", line 69, in read
        self.parse()
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/readers/__init__.py", line 75, in parse
        self.parser.parse(self.input, document)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/__init__.py", line 157, in parse
        self.statemachine.run(inputlines, document, inliner=self.inliner)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 170, in run
        input_source=document['source'])
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/statemachine.py", line 237, in run
        context, state, transitions)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/statemachine.py", line 458, in check_line
        return method(match, context, next_state)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 2709, in underline
        self.section(title, source, style, lineno - 1, messages)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 329, in section
        self.new_subsection(title, lineno, messages)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 398, in new_subsection
        node=section_node, match_titles=1)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 284, in nested_parse
        node=node, match_titles=match_titles)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 195, in run
        results = StateMachineWS.run(self, input_lines, input_offset)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/statemachine.py", line 237, in run
        context, state, transitions)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/statemachine.py", line 458, in check_line
        return method(match, context, next_state)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 2283, in explicit_markup
        nodelist, blank_finish = self.explicit_construct(match)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 2295, in explicit_construct
        return method(self, expmatch)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 2036, in directive
        directive_class, match, type_name, option_presets)
      File "/Library/Python/2.7/site-packages/docutils-0.8.1-py2.7.egg/docutils/parsers/rst/states.py", line 2087, in run_directive
        result = directive_instance.run()
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/domains/__init__.py", line 190, in run
        return BaseDirective.run(self)
      File "/Library/Python/2.7/site-packages/Sphinx-1.1.2-py2.7.egg/sphinx/domains/std.py", line 318, in run
        self.state.nested_parse(definition, definition.items[0][1], defnode)
    IndexError: list index out of range
    

    This appears in a glossary directive with comments, like:

    .. glossary:
       :sorted:
    
       .. some comment .......................
    
       term_a
           definition text
    
       .. some comment .......................
    
       term_b
            definition text
    

    Removing the comments fixes it for 1.1.x. The comments used to work in 1.0.x.

  3. Log in to comment