python-openflow icon indicating copy to clipboard operation
python-openflow copied to clipboard

"Recursion error" when building documentation with Sphinx >= 2.1

Open hdiogenes opened this issue 4 years ago • 2 comments

$ make -C docs/ default doctest
make clean
rm -rf pyof.*
rm -rf _build/*
make dirhtml
sphinx-apidoc -o . ../pyof/ -d10 -M -T
Creating file ./pyof.rst.
Creating file ./pyof.foundation.rst.
Creating file ./pyof.v0x01.rst.
Creating file ./pyof.v0x01.asynchronous.rst.
Creating file ./pyof.v0x01.common.rst.
Creating file ./pyof.v0x01.controller2switch.rst.
Creating file ./pyof.v0x01.symmetric.rst.
Creating file ./pyof.v0x04.rst.
Creating file ./pyof.v0x04.asynchronous.rst.
Creating file ./pyof.v0x04.common.rst.
Creating file ./pyof.v0x04.controller2switch.rst.
Creating file ./pyof.v0x04.symmetric.rst.
#sed -i "/Submodules/,+1d" *.rst
#sed -i "/Subpackages/,+1d" *.rst
sphinx-build -b dirhtml -d _build/doctrees  -W . _build/dirhtml
Running Sphinx v2.1.2
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
building [dirhtml]: targets for 19 source files that are out of date
updating environment: 19 added, 0 changed, 0 removed
reading sources... [ 42%] pyof.foundation
Recursion error:
maximum recursion depth exceeded while calling a Python object

This can happen with very large or deeply nested source files.  You can carefully increase the default Python recursion limit of 1000 in conf.py with e.g.:
    import sys; sys.setrecursionlimit(1500)
make[1]: *** [dirhtml] Error 2
make: *** [default] Error 2

Older versions work:

$ pip install -U 'sphinx<2.1'
$ make -C docs/ default doctest
...
build succeeded.

hdiogenes avatar Apr 03 '20 16:04 hdiogenes