Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: list index out of range #33

Open
Pierre-Gronau-ndaal opened this issue Mar 19, 2021 · 6 comments
Open

IndexError: list index out of range #33

Pierre-Gronau-ndaal opened this issue Mar 19, 2021 · 6 comments

Comments

@Pierre-Gronau-ndaal
Copy link

Sphinx version: 3.3.1

Python version: 3.7.3 (CPython)

Docutils version: 0.16 release

Jinja2 version: 2.11.3

Last messages:

_glossary/_EN/glossary_W

_glossary/_EN/glossary_X

_glossary/_EN/glossary_Y

_glossary/_EN/glossary_Z

appendix

_appendix/appendix_downloads

_appendix/appendix_tables

_appendix/appendix_index

writing...

Loaded extensions:

sphinx.ext.mathjax (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/mathjax.py

sphinxcontrib.applehelp (1.0.2) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/applehelp/init.py

sphinxcontrib.devhelp (1.0.2) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/devhelp/init.py

sphinxcontrib.htmlhelp (1.0.3) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/htmlhelp/init.py

sphinxcontrib.serializinghtml (1.1.4) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/serializinghtml/init.py

sphinxcontrib.qthelp (1.0.3) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/qthelp/init.py

alabaster (0.7.8) from /usr/lib/python3/dist-packages/alabaster/init.py

sphinx.ext.autodoc.type_comment (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/autodoc/type_comment.py

sphinx.ext.autodoc (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/autodoc/init.py

sphinx.ext.autosummary (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/autosummary/init.py

sphinx.ext.coverage (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/coverage.py

sphinx.ext.doctest (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/doctest.py

sphinx.ext.extlinks (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/extlinks.py

sphinx.ext.githubpages (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/githubpages.py

sphinx.ext.graphviz (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/graphviz.py

sphinx.ext.ifconfig (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/ifconfig.py

sphinx.ext.imgmath (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/imgmath.py

sphinx.ext.inheritance_diagram (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/inheritance_diagram.py

sphinx.ext.intersphinx (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/intersphinx.py

sphinx.ext.napoleon (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/napoleon/init.py

sphinx_sitemap (unknown version) from /usr/local/lib/python3.7/dist-packages/sphinx_sitemap/init.py

sphinx.ext.todo (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/todo.py

sphinx.ext.viewcode (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/viewcode.py

sphinxcontrib.swaggerdoc (unknown version) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/swaggerdoc/init.py

sphinxcontrib.programoutput (unknown version) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/programoutput/init.py

sphinxcontrib.plantuml (unknown version) from /usr/lib/python3/dist-packages/sphinxcontrib/plantuml.py

sphinxcontrib.httpdomain (unknown version) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/httpdomain.py

sphinxcontrib.openapi (None) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/openapi/init.py

sphinxcontrib.details.directive (0.1.0) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/details/directive/init.py

sphinxcontrib.needs (0.6.0) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/needs/init.py

docxsphinx (unknown version) from /usr/local/lib/python3.7/dist-packages/docxsphinx/init.py

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/usr/local/lib/python3.7/dist-packages/sphinx/application.py", line 352, in build
self.builder.build_update()
File "/usr/local/lib/python3.7/dist-packages/sphinx/builders/init.py", line 294, in build_update
self.build(['all'], to_build)
File "/usr/local/lib/python3.7/dist-packages/sphinx/builders/init.py", line 361, in build
self.write(docnames, list(updated_docnames), method)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/builder.py", line 85, in write
self.write_doc(docname, doctree)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/builder.py", line 90, in write_doc
self.writer.write(doctree, destination)
File "/usr/local/lib/python3.7/dist-packages/docutils/writers/init.py", line 78, in write
self.translate()
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/writer.py", line 98, in translate
self.document.walkabout(visitor)
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
[Previous line repeated 2 more times]
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 206, in walkabout
visitor.dispatch_visit(self)
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 1995, in dispatch_visit
return method(node)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/writer.py", line 1106, in visit_comment
comment = node[0]
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 627, in getitem
return self.children[key]
IndexError: list index out of range

based on debian 10.8

@hugobuddel
Copy link
Collaborator

Thank you for the report. Does this happen with the demos included in the repository or with your own rst file?

Unfortunately we have not much time to dedicate to this project, so not sure whether we can look at it soon.

@Pierre-Gronau-ndaal
Copy link
Author

Your examples are working ...

I disabled all extensions and had the following output in the console:

writing...
Exception occurred:
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 627, in getitem
return self.children[key]
IndexError: list index out of range
The full traceback has been saved in /tmp/sphinx-err-r_hy99r2.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: *** [Makefile:20: docx] Fehler 2

here the log content:

.log

Sphinx version: 3.3.1

Python version: 3.7.3 (CPython)

Docutils version: 0.16 release

Jinja2 version: 2.11.3

Last messages:

_glossary/_EN/glossary_W

_glossary/_EN/glossary_X

_glossary/_EN/glossary_Y

_glossary/_EN/glossary_Z

appendix

_appendix/appendix_downloads

_appendix/appendix_tables

_appendix/appendix_index

writing...

Loaded extensions:

sphinx.ext.mathjax (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/mathjax.py

sphinxcontrib.applehelp (1.0.2) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/applehelp/init.py

sphinxcontrib.devhelp (1.0.2) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/devhelp/init.py

sphinxcontrib.htmlhelp (1.0.3) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/htmlhelp/init.py

sphinxcontrib.serializinghtml (1.1.4) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/serializinghtml/init.py

sphinxcontrib.qthelp (1.0.3) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/qthelp/init.py

alabaster (0.7.8) from /usr/lib/python3/dist-packages/alabaster/init.py

docxsphinx (unknown version) from /usr/local/lib/python3.7/dist-packages/docxsphinx/init.py

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/usr/local/lib/python3.7/dist-packages/sphinx/application.py", line 352, in build
self.builder.build_update()
File "/usr/local/lib/python3.7/dist-packages/sphinx/builders/init.py", line 294, in build_update
self.build(['all'], to_build)
File "/usr/local/lib/python3.7/dist-packages/sphinx/builders/init.py", line 361, in build
self.write(docnames, list(updated_docnames), method)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/builder.py", line 85, in write
self.write_doc(docname, doctree)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/builder.py", line 90, in write_doc
self.writer.write(doctree, destination)
File "/usr/local/lib/python3.7/dist-packages/docutils/writers/init.py", line 78, in write
self.translate()
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/writer.py", line 98, in translate
self.document.walkabout(visitor)
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
[Previous line repeated 2 more times]
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 206, in walkabout
visitor.dispatch_visit(self)
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 1995, in dispatch_visit
return method(node)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/writer.py", line 1106, in visit_comment
comment = node[0]
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 627, in getitem
return self.children[key]
IndexError: list index out of range

now with the same extensions as in your examples:

 'sphinx.ext.intersphinx',
 'sphinx.ext.todo',
 'sphinx.ext.mathjax',
 'sphinx.ext.viewcode',
 'docxsphinx',

The results that in the log are:

Sphinx version: 3.3.1

Python version: 3.7.3 (CPython)

Docutils version: 0.16 release

Jinja2 version: 2.11.3

Last messages:

_glossary/_EN/glossary_W

_glossary/_EN/glossary_X

_glossary/_EN/glossary_Y

_glossary/_EN/glossary_Z

appendix

_appendix/appendix_downloads

_appendix/appendix_tables

_appendix/appendix_index

writing...

Loaded extensions:

sphinx.ext.mathjax (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/mathjax.py

sphinxcontrib.applehelp (1.0.2) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/applehelp/init.py

sphinxcontrib.devhelp (1.0.2) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/devhelp/init.py

sphinxcontrib.htmlhelp (1.0.3) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/htmlhelp/init.py

sphinxcontrib.serializinghtml (1.1.4) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/serializinghtml/init.py

sphinxcontrib.qthelp (1.0.3) from /usr/local/lib/python3.7/dist-packages/sphinxcontrib/qthelp/init.py

alabaster (0.7.8) from /usr/lib/python3/dist-packages/alabaster/init.py

sphinx.ext.intersphinx (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/intersphinx.py

sphinx.ext.todo (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/todo.py

sphinx.ext.viewcode (3.3.1) from /usr/local/lib/python3.7/dist-packages/sphinx/ext/viewcode.py

docxsphinx (unknown version) from /usr/local/lib/python3.7/dist-packages/docxsphinx/init.py

Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/sphinx/cmd/build.py", line 280, in build_main
app.build(args.force_all, filenames)
File "/usr/local/lib/python3.7/dist-packages/sphinx/application.py", line 352, in build
self.builder.build_update()
File "/usr/local/lib/python3.7/dist-packages/sphinx/builders/init.py", line 294, in build_update
self.build(['all'], to_build)
File "/usr/local/lib/python3.7/dist-packages/sphinx/builders/init.py", line 361, in build
self.write(docnames, list(updated_docnames), method)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/builder.py", line 85, in write
self.write_doc(docname, doctree)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/builder.py", line 90, in write_doc
self.writer.write(doctree, destination)
File "/usr/local/lib/python3.7/dist-packages/docutils/writers/init.py", line 78, in write
self.translate()
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/writer.py", line 98, in translate
self.document.walkabout(visitor)
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 214, in walkabout
if child.walkabout(visitor):
[Previous line repeated 2 more times]
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 206, in walkabout
visitor.dispatch_visit(self)
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 1995, in dispatch_visit
return method(node)
File "/usr/local/lib/python3.7/dist-packages/docxsphinx/writer.py", line 1106, in visit_comment
comment = node[0]
File "/usr/local/lib/python3.7/dist-packages/docutils/nodes.py", line 627, in getitem
return self.children[key]
IndexError: list index out of range

I have no glue, but my first guess is that you have defined a array and you you reach your limit and is not dynamically addressed
I used nearly 400k files ..

but with my CV files just 25 the same results ...

If it is helpful I can upload my CV files - they are public anyway

@Pierre-Gronau-ndaal
Copy link
Author

the examples work

@hugobuddel
Copy link
Collaborator

It would indeed be useful if you could include an example, the smaller the better. Without an example we cannot reproduce the error and thus not fix the bug.

@Pierre-Gronau-ndaal
Copy link
Author

@hugobuddel
Copy link
Collaborator

Thanks @Pierre-Gronau-ndaal . I've reproduced the error.

It is caused by the empty .. line in index.rst. That is, it works if you replace

.. Indices and tables
.. ==================
..
.. * :ref:`genindex`
.. * :ref:`modindex`
.. * :ref:`search

with

.. Indices and tables
.. ==================
.. * :ref:`genindex`
.. * :ref:`modindex`
.. * :ref:`search

What I did to figure this out is to simply remove things from your document until the problem went away, and then add things back to see when the problem returned. That is a strategy you can also employ yourself so you can continue with your work without having to wait for us.

This is indeed a bug that we should fix. However, I propose that, for now, you simply remove the line with the two dots because it does not seem to make a difference and it might take a while before we'll get to fixing it.

However, I would not recommend using our tool to write a Curriculum Vitae, as the docx documents are very basic. What you can do to improve them, is add your own template docx file. This is an empty docx file that does have all the styles you want. The default is used if you do not provide one, and unfortunately the default is not empty, see #39 (that is where the Japanese text comes from). (We should really work on that.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants