summaryrefslogtreecommitdiff
path: root/sphinx/ext/graphviz.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-08 15:58:57 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-08 15:59:02 +0900
commitbc081e44f8b438fa1e02b17bf6c4f4ea9c91126c (patch)
treee6c6ef4c1dbe8781b89abf7d399e67a3f9b493b3 /sphinx/ext/graphviz.py
parent559c8202146eb4682d3babb648a4aa5b6c588977 (diff)
downloadsphinx-git-bc081e44f8b438fa1e02b17bf6c4f4ea9c91126c.tar.gz
Fix annotations
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