Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I'm using Sphinx documentation tool which shows error: "maximum recursion depth exceeded in cmp"

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.

like image 292
Ankush Shingade Avatar asked Mar 05 '26 07:03

Ankush Shingade


1 Answers

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!

like image 75
Good Lux Avatar answered Mar 07 '26 05:03

Good Lux



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!