question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"TypeError: 'generator' object is not reversible" during RTD builds

See original GitHub issue

Update a PR will the latest changes from master, and the RTD build will fail with the following error: (example build)

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/lib/python3.7/site-packages/sphinx/application.py", line 341, in build
    self.builder.build_update()
  File "/home/docs/checkouts/readthedocs.org/user_builds/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/lib/python3.7/site-packages/sphinx/io.py", line 318, in read_doc
    pub.publish()
  File "/home/docs/checkouts/readthedocs.org/user_builds/ivado-medical-imaging/envs/949/lib/python3.7/site-packages/docutils/core.py", line 219, in publish
    self.apply_transforms()
  File "/home/docs/checkouts/readthedocs.org/user_builds/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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/ivado-medical-imaging/envs/949/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-1ck_ok_w.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!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
dyt811commented, Oct 26, 2021

Okay. Gonna try 4.2.0 as per https://github.com/readthedocs/readthedocs.org/blob/master/requirements/pip.txt#L15 said and see how it goes.

0reactions
joshuacwnewtoncommented, Oct 26, 2021

So I would suggest we take a closer look at why we’re pinning Sphinx to such a low version number.

It looks like this was done in https://github.com/ivadomed/ivadomed/pull/429, with more context in https://github.com/ivadomed/ivadomed/issues/428.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Implement a reversible iteration class to replace a generator
In the simple generator case, I can do a = instance.mygen(); print(next(a)) , but when I return a _ReversibleIterator , next produces an...
Read more >
Vince Knight on Twitter: "Documentation friends: we're getting a ...
Documentation friends: we're getting a Traceback I've not seen before on a PR build from rtd: ``` ... TypeError: 'generator' object is not...
Read more >
Read the Docsでビルドが失敗している件 - rcmdnk's blog
“TypeError: 'generator' object is not reversible” during RTD builds ... version: 2 # Build from the docs/ directory with Sphinx sphinx: ...
Read more >
Changelog - Sphinx documentation
#10498: gettext: TypeError is raised when sorting warning messages if a node has no line number. Patch by Adam Turner. #10493: HTML Theme:...
Read more >
https://readthedocs.com/api/v2/build/760332.txt
Read the Docs build information Build id: 760332 Project: nubeva-docs ... TypeError: 'generator' object is not reversible The full traceback has been saved ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found