You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: 'generator' object is not reversible #9727
My cmd:
/usr/local/bin/sphinx-build -b man -t man -d /root/bu/ceph/build/doc/doctrees -c /root/bu/ceph/man /root/bu/ceph/doc/man /root/bu/ceph/build/doc/man
Error Message:
Running Sphinx v1.7.6
loading pickled environment... not yet created
building [mo]: targets for 0 po files that are out of date
building [man]: all manpages
updating environment: 46 added, 0 changed, 0 removed
reading sources... [ 2%] 8/ceph
reading sources... [ 4%] 8/ceph-authtool
reading sources... [ 6%] 8/ceph-bluestore-tool
Exception occurred:
File "/usr/local/Python-3.6.15/lib/python3.6/site-packages/Sphinx-1.7.6.dev20211011-py3.6.egg/sphinx/util/nodes.py", line 57, 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-jpnnyy28.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!
Reacted by Dominik Roos, Thomas Picariello, Frederike Dümbgen, Nikita Melentev, Brett Nelson, Aaron Bach, Saransh Chopra, Sownak Roy, J_hao104, Fritz Obermeyer and 2 more
Running Sphinx v1.8.5
loading translations [en]... done
making output directory...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 15 source files that are out of date
updating environment: 15 added, 0 changed, 0 removed
reading sources... [ 6%] hardware/hardware
reading sources... [ 13%] index
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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-u2codvq0.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!
The recommended way is upgrading Sphinx to the latest one. It has already pinned the version of docutils. I think no reason to keep using the old version of Sphinx. Let's upgrade!
Activity
throneofshadow commentedon Oct 26, 2021
Have this error as well.
Running Sphinx v1.8.5
loading translations [en]... done
making output directory...
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 15 source files that are out of date
updating environment: 15 added, 0 changed, 0 removed
reading sources... [ 6%] hardware/hardware
reading sources... [ 13%] index
Traceback (most recent call last):
File "/home/docs/checkouts/readthedocs.org/user_builds/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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/reachmaster/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-u2codvq0.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!
andrewegel commentedon Oct 26, 2021
I encountered this in my own way. Check your version of docutils thats being utilized here. There was a recent docutils-0.18 release that made a note of this change: https://docutils.sourceforge.io/RELEASE-NOTES.html#release-0-18-2021-10-26
Pinning
docutils==0.17.1resolved this issue for us.pohmelie commentedon Oct 26, 2021
This breaks readthedocs build for me. https://readthedocs.org/projects/aioftp/builds/15099286/
astrojuanlu commentedon Oct 26, 2021
Hi @pohmelie , Juan Luis from Read the Docs here - that's to be expected, pin your docutils version to
<0.18throneofshadow commentedon Oct 26, 2021
Pinning docutils to <0.18 works!!! Thanks everyone!
Try this solution:
JohnPaton commentedon Oct 27, 2021
Shouldn't Sphinx change its own requirements to include
docutils<0.18in this case?pohmelie commentedon Oct 27, 2021
@JohnPaton, actually it is already in https://github.com/sphinx-doc/sphinx/blob/4.x/setup.py#L26
Update requirements.txt
cirospat commentedon Oct 27, 2021
thanks you for your replies.
Problem solved.
pin
docutils<0.18in your
requirements.txt file,and have a
.readthedocs.yamlfile with these contents:as reported by @astrojuanlu
here: readthedocs/readthedocs.org#8616 (comment)
I followed this instruction and it works! Build succes
tk0miya commentedon Oct 27, 2021
The recommended way is upgrading Sphinx to the latest one. It has already pinned the version of docutils. I think no reason to keep using the old version of Sphinx. Let's upgrade!
17 remaining items
Request at least Sphinx 2.0 to avoid a dependency problem in RTD [ski…
Docs: Pin Sphinx<4
Fix build for RTD.
Docs: Pin Sphinx>4
Fix build for RTD.
Fix documentation error
Fix documentation error (#184)
Added docs/requirements.txt file to fix the docutils python package v…
Pin docutils, should fix #145
trying to fix our readthedocs
docs: use earlier version of docutils
add separate requirements file for docs, so we can pin docutils versi…
Pinned docutils per this convo sphinx-doc/sphinx#9727 (comment)