summaryrefslogtreecommitdiff
path: root/sphinx/ext/graphviz.py
diff options
context:
space:
mode:
authorWAKAYAMA Shirou <shirou.faw@gmail.com>2014-08-14 20:31:36 +0900
committerWAKAYAMA Shirou <shirou.faw@gmail.com>2014-08-14 20:31:36 +0900
commit0a07f9225b6f7659dc03e5d49424bd9f57eaf1f2 (patch)
treea97f30d617762acc67f4f9a08d1d9837e3a09c05 /sphinx/ext/graphviz.py
parent90a651fa5bb0b205875121bb22853c92d4d545e6 (diff)
downloadsphinx-0a07f9225b6f7659dc03e5d49424bd9f57eaf1f2.tar.gz
if code is not unicode, change to unicode in ext/graphviz.py.
Diffstat (limited to 'sphinx/ext/graphviz.py')
-rw-r--r--sphinx/ext/graphviz.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index 3c2bacee..513dfe97 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -139,6 +139,11 @@ class GraphvizSimple(Directive):
def render_dot(self, code, options, format, prefix='graphviz'):
"""Render graphviz code into a PNG or PDF output file."""
+
+ # if code is not unicode, convert to unicode. it is expected utf-8
+ if not isinstance(code, text_type):
+ code = code.decode('utf-8')
+
hashkey = (code + str(options) + \
str(self.builder.config.graphviz_dot) + \
str(self.builder.config.graphviz_dot_args)