#1259: Guard the debug output call when emitting events; to prevent the

repr() implementation of arbitrary objects causing build failures.
This commit is contained in:
Georg Brandl 2013-09-16 09:31:05 +02:00
parent 44418fd1a1
commit f4a0a81f4c
2 changed files with 7 additions and 1 deletions

View File

@ -58,6 +58,8 @@ Bugs fixed
* PR#146,#1172: Fix ZeroDivisionError in parallel builds. Thanks to tychoish.
* #1206: Fix i18n: gettext did not translate admonition directive's title.
* #1232: Sphinx generated broken ePub files on Windows.
* #1259: Guard the debug output call when emitting events; to prevent the
repr() implementation of arbitrary objects causing build failures.
Release 1.2 beta1 (released Mar 31, 2013)

View File

@ -347,7 +347,11 @@ class Sphinx(object):
event.pop(listener_id, None)
def emit(self, event, *args):
self.debug2('[app] emitting event: %r%s', event, repr(args)[:100])
try:
self.debug2('[app] emitting event: %r%s', event, repr(args)[:100])
except Exception: # not every object likes to be repr()'d (think
# random stuff coming via autodoc)
pass
results = []
if event in self._listeners:
for _, callback in self._listeners[event].iteritems():