3

I am using Sphinx documentation tool. While making HTML files using RST files, following error is shown with a hint to solve the error:

Recursion error: maximum recursion depth exceeded in cmp 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 Example:

import sys; sys.setrecursionlimit(1500)

I have tried increasing the sys.setrecursionlimit(), but this solution is not working out.

Apart from this, I tried changing the theme for HTML output. But the error remains; regardless of HTML theme.

3
  • 3
    do you have the full traceback? It is hard to help you without knowing where the error is coming from? Commented Jul 17, 2017 at 8:21
  • @FrancescoMontesano I am not getting full traceback. The system says: build succeeded, 5 warnings. After that above Recursion error is shown. I was looking into Temp folder for full traceback. Do I have to check some where else? Commented Jul 17, 2017 at 10:35
  • 1
    I'm sure that you are not going to solve the problem increasing the recursion limit. Usually if you hit this error, there is some bug. Look at the help of sphinx-build there are a few options (e.g. -P, -W that might help) Commented Jul 17, 2017 at 13:11

1 Answer 1

4

I had this same problem, and tried slowly increasing the recursionLimit, which was a waste of time (is started having segmentation faults at ~40300).

What solved the problem for me was editing my index.rst

I had a wildcard in the toctree like this

MyCodeLibrary
##############

.. toctree::
   :glob:

   /*

I fixed it by doing this:

MyCodeLibrary
##############

.. toctree::
   :glob:

   mycodelibrary/*

Hope this helps!

Sign up to request clarification or add additional context in comments.

1 Comment

I attempted to do this, and it yields no results at all, is anyone else encountering this issue? I increased the recursion limit to something like 10000, and addressed the wildcard

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.