mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
fix debug2 UnicodeEncodeError issue with multibyte names node
This commit is contained in:
@@ -343,7 +343,8 @@ class Sphinx(object):
|
||||
event.pop(listener_id, None)
|
||||
|
||||
def emit(self, event, *args):
|
||||
self.debug2('[app] emitting event: %r%s', event, str(args)[:100])
|
||||
args_repr = repr(map(unicode, args))[:100]
|
||||
self.debug2('[app] emitting event: %s%s', event, args_repr)
|
||||
results = []
|
||||
if event in self._listeners:
|
||||
for _, callback in self._listeners[event].iteritems():
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
from StringIO import StringIO
|
||||
|
||||
from docutils import nodes
|
||||
from sphinx.application import ExtensionError
|
||||
from sphinx.domains import Domain
|
||||
|
||||
@@ -41,6 +42,12 @@ def test_events(app):
|
||||
"Callback called when disconnected"
|
||||
|
||||
|
||||
@with_app()
|
||||
def test_emit_with_multibyte_name_node(app):
|
||||
node = nodes.section(names=[u'\u65e5\u672c\u8a9e'])
|
||||
app.emit('my_event', node)
|
||||
|
||||
|
||||
def test_output():
|
||||
status, warnings = StringIO(), StringIO()
|
||||
app = TestApp(status=status, warning=warnings)
|
||||
|
||||
Reference in New Issue
Block a user