From ab07eba89591b2909d643aaefd5c432604d0a294 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 28 Apr 2009 23:14:29 +0200 Subject: [PATCH] Convert strings to unicode in highlighting. --- sphinx/highlighting.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sphinx/highlighting.py b/sphinx/highlighting.py index 61c413d7a..c41720ad3 100644 --- a/sphinx/highlighting.py +++ b/sphinx/highlighting.py @@ -158,6 +158,8 @@ class PygmentsBridge(object): return True def highlight_block(self, source, lang, linenos=False): + if isinstance(source, str): + source = source.decode() if not pygments: return self.unhighlighted(source) if lang in ('py', 'python'):