Skip to content

Commit

Permalink
Print full traceback on internal fatal error
Browse files Browse the repository at this point in the history
  • Loading branch information
kdeldycke committed Jan 14, 2025
1 parent e7dd42e commit 2d8ee8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Features added
Patch by Chris Barrick.
* #13227: Implement the :rst:role:`kbd` role as a ``SphinxRole``.
Patch by Adam Turner.
* #13163: Always print tracebacks in full when Sphinx encounters an internal
error.
Patch by Kevin Deldycke.

Bugs fixed
----------
Expand Down
4 changes: 3 additions & 1 deletion sphinx/_cli/util/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,9 +225,11 @@ def print_red(*values: str) -> None:

print_red(__('Exception occurred:'))
print_err(formatted_tb)
traceback_info_path = save_traceback(
traceback_output = full_exception_context(
exception, message_log=message_log, extensions=extensions
)
print_err(traceback_output)
traceback_info_path = write_temporary_file(traceback_output)
print_err(__('The full traceback has been saved in:'))
print_err(traceback_info_path)
print_err()
Expand Down

0 comments on commit 2d8ee8f

Please sign in to comment.