summaryrefslogtreecommitdiff
path: root/sphinx/ext/graphviz.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/ext/graphviz.py')
-rw-r--r--sphinx/ext/graphviz.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index c56c7cebd..3c0cbed68 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -237,10 +237,6 @@ def render_dot(self, code, options, format, prefix='graphviz'):
ensuredir(path.dirname(outfn))
- # graphviz expects UTF-8 by default
- if isinstance(code, text_type):
- code = code.encode('utf-8')
-
dot_args = [graphviz_dot]
dot_args.extend(self.builder.config.graphviz_dot_args)
dot_args.extend(['-T' + format, '-o' + outfn])
@@ -264,7 +260,7 @@ def render_dot(self, code, options, format, prefix='graphviz'):
try:
# Graphviz may close standard input when an error occurs,
# resulting in a broken pipe on communicate()
- stdout, stderr = p.communicate(code)
+ stdout, stderr = p.communicate(code.encode('utf-8'))
except (OSError, IOError) as err:
if err.errno not in (EPIPE, EINVAL):
raise