Closes #2324: Print a hint how to increase the recursion limit when it is hit.

This commit is contained in:
Georg Brandl 2016-02-16 19:19:54 +01:00
parent 532e99c96b
commit 4cc2d0114c
2 changed files with 9 additions and 0 deletions

View File

@ -19,6 +19,7 @@ Bugs fixed
* #2287: ``sphinx.transforms.Locale`` always uses rst parser. Sphinx i18n feature should
support parsers that specified source_parsers.
* #2290: Fix ``sphinx.ext.mathbase`` use of amsfonts may break user choice of math fonts
* #2324: Print a hint how to increase the recursion limit when it is hit.
Release 1.3.5 (released Jan 24, 2016)

View File

@ -270,6 +270,14 @@ def main(argv):
print(red('The full traceback has been saved in %s, if you want '
'to report the issue to the developers.' % tbpath),
file=error)
elif isinstance(err, RuntimeError) and 'recursion depth' in str(err):
print(red('Recursion error:'), file=error)
print(terminal_safe(text_type(err)), file=error)
print(file=error)
print('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.:', file=error)
print(' import sys; sys.setrecursionlimit(1500)', file=error)
else:
print(red('Exception occurred:'), file=error)
print(format_exception_cut_frames().rstrip(), file=error)