Sphinx: index out of range during make

Created on 3 Jan 2015  路  3Comments  路  Source: sphinx-doc/sphinx

This is NOT a duplicate of the previously reported bug for maxindex.

# Sphinx version: 1.2.2
# Python version: 2.7.6
# Docutils version: 0.11 release
# Jinja2 version: 2.7.2
# Loaded extensions:
#   sphinx.ext.autodoc from c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\ext\autodoc.pyc
#   sphinx.ext.viewcode from c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\ext\viewcode.pyc
#   sphinx.ext.oldcmarkup from c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\ext\oldcmarkup.pyc
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\cmdline.py", line 254, in main
    app.build(force_all, filenames)
  File "c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\application.py", line 212, in build
    self.builder.build_update()
  File "c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\builders\__init__.py", line 214, in build_update
    'out of date' % len(to_build))
  File "c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\builders\__init__.py", line 279, in build
    self.finish()
  File "c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\builders\html.py", line 453, in finish
    for pagename, context, template in pagelist:
  File "c:\python27\lib\site-packages\sphinx-1.2.2-py2.7.egg\sphinx\ext\viewcode.py", line 118, in collect_pages
    + lines[start])
IndexError: list index out of range

bug extensions help wanted

Most helpful comment

I can't reproduce this bug. It would be nice if anyone has reproducible example.

All 3 comments

_From buckjw on 2014-04-17 00:59:20+00:00_

Got the build to complete by inserting this snippet in viewcode.py

#!python

if start > len(lines):
  continue

I think I am seeing the same issue, _intermittently_, in a more recent component versions, running on Jython2.7.0.

# Sphinx version: 1.3.3
# Python version: 2.7.0 (Jython)
# Docutils version: 0.12 release
# Jinja2 version: 2.8
...
# Loaded extensions:
#   sphinx.ext.autodoc (1.3.3) from /usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/ext/autodoc$py.class
#   sphinx.ext.viewcode (1.3.3) from /usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/ext/viewcode$py.class
#   alabaster (0.7.7) from /usr/local/jython2.7.0/Lib/site-packages/alabaster-0.7.7-py2.7.egg/alabaster/__init__$py.class
...
Traceback (most recent call last):
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/cmdline.py", line 240, in main
    app.build(opts.force_all, filenames)
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/application.py", line 266, in build
    self.builder.build_update()
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/builders/__init__.py", line 250, in build_update
    self.build(to_build,
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/builders/__init__.py", line 326, in build
    self.finish()
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/builders/html.py", line 456, in finish
    self.finish_tasks.add_task(self.gen_additional_pages)
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/util/parallel.py", line 39, in add_task
    res = task_func()
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/builders/html.py", line 481, in gen_additional_pages
    for pagename, context, template in pagelist:
  File "/usr/local/jython2.7.0/Lib/site-packages/Sphinx-1.3.3-py2.7.egg/sphinx/ext/viewcode.py", line 156, in collect_pages
    lines[start] = (
IndexError: index out of range: 8716

I can't reproduce this bug. It would be nice if anyone has reproducible example.

Was this page helpful?
0 / 5 - 0 ratings