Skip to content

TypeError: 'generator' object is not reversible #9809

Closed

Description

@SchoolGuy

Describe the bug

When building my Projekt on RTD I get a stacktrace which I can't reproduce locally.

Running Sphinx v1.8.5
loading translations [en]... done
making output directory...
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 27 source files that are out of date
updating environment: 27 added, 0 changed, 0 removed
reading sources... [  3%] cobbler

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/cmd/build.py", line 304, in build_main
    app.build(args.force_all, filenames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/application.py", line 341, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 347, in build_update
    len(to_build))
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 360, in build
    updated_docnames = set(self.read())
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 468, in read
    self._read_serial(docnames)
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 490, in _read_serial
    self.read_doc(docname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/builders/__init__.py", line 534, in read_doc
    doctree = read_doc(self.app, self.env, self.env.doc2path(docname))
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/io.py", line 318, in read_doc
    pub.publish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/docutils/core.py", line 219, in publish
    self.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/docutils/core.py", line 200, in apply_transforms
    self.document.transformer.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/transforms/__init__.py", line 90, in apply_transforms
    Transformer.apply_transforms(self)
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/docutils/transforms/__init__.py", line 171, in apply_transforms
    transform.apply(**kwargs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/transforms/__init__.py", line 245, in apply
    apply_source_workaround(n)
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/util/nodes.py", line 94, in apply_source_workaround
    for classifier in reversed(node.parent.traverse(nodes.classifier)):
TypeError: 'generator' object is not reversible

Exception occurred:
  File "/home/docs/checkouts/readthedocs.org/user_builds/cobbler/envs/latest/lib/python3.7/site-packages/sphinx/util/nodes.py", line 94, in apply_source_workaround
    for classifier in reversed(node.parent.traverse(nodes.classifier)):
TypeError: 'generator' object is not reversible
The full traceback has been saved in /tmp/sphinx-err-id_ia31r.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!

How to Reproduce

Not reproducible locally

Expected behavior

Project builds successfully.

Your project

https://readthedocs.org/projects/cobbler

Screenshots

No response

OS

Linux

Python version

3.7

Sphinx version

1.8.5

Sphinx extensions

sphinx.ext.autodoc, sphinx.ext.doctest, sphinx.ext.intersphinx, sphinx.ext.todo', 'sphinx.ext.coverage, sphinx.ext.mathjax, sphinx.ext.ifconfig, sphinx.ext.viewcode

Extra tools

No response

Additional context

https://readthedocs.org/projects/cobbler/builds/15157681/

Activity

  1. gmilde commented on Nov 5, 2021

    @gmilde
    Contributor

    This is another duplicate of #9810.
    As these duplicates keep coming, maybe considering the long term support request for 1.x and 2.x in #9807 may ease not only RTD users frustration but also Sphinx developers issue maintenance burden.

  2. SchoolGuy commented on Nov 5, 2021

    @SchoolGuy
    Author

    My issue got solved exactly as described in the linked issue. I will close it thus!

  3. added
    docutils
    and removed on Nov 7, 2021
  4. locked as resolved and limited conversation to collaborators on Dec 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    closed:duplicatedocutilstype:question

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions