1. Georg Brandl
  2. sphinx


Georg Brandl  committed f8bd2af

Add list of extensions to the traceback log file on unhandled exceptions.

  • Participants
  • Parent commits 0ae8e06
  • Branches default

Comments (0)

Files changed (2)

File sphinx/cmdline.py

View file
             print >>status, 'Making output directory...'
+    app = None
         app = Sphinx(srcdir, confdir, outdir, doctreedir, buildername,
                      confoverrides, status, warning, freshenv,
                 print >>error, red('Exception occurred:')
                 print >>error, format_exception_cut_frames().rstrip()
-                tbpath = save_traceback()
+                tbpath = save_traceback(app)
                 print >>error, red('The full traceback has been saved '
                                    'in %s, if you want to report the '
                                    'issue to the developers.' % tbpath)

File sphinx/util/__init__.py

View file
 # Python version: %s
 # Docutils version: %s %s
 # Jinja2 version: %s
+# Loaded extensions: %s
-def save_traceback():
+def save_traceback(app):
     """Save the current exception's traceback in a temporary file."""
     import platform
     exc = traceback.format_exc()
     fd, path = tempfile.mkstemp('.log', 'sphinx-err-')
+    if app is not None:
+        extension_list = ', '.join(app._extensions)
+    else:
+        extension_list = '(app not created)'
     os.write(fd, (_DEBUG_HEADER %
                    docutils.__version__, docutils.__version_details__,
-                   jinja2.__version__)).encode('utf-8'))
+                   jinja2.__version__,
+                   extension_list)).encode('utf-8'))
     os.write(fd, exc.encode('utf-8'))
     return path