diff --git a/CHANGES b/CHANGES index 09c05a5bf..fcec61f7f 100644 --- a/CHANGES +++ b/CHANGES @@ -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) diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py index 21422be51..2ba4c4f09 100644 --- a/sphinx/cmdline.py +++ b/sphinx/cmdline.py @@ -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)