From 49bd372142899093e2340556ffbe1f927127cafb Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Wed, 27 Feb 2019 23:20:40 +0900 Subject: [PATCH] Fix #6028: graphviz: Ensure the graphviz filenames are reproducible --- CHANGES | 1 + sphinx/ext/graphviz.py | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index 65f39e538ba..11e9c6137d1 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,7 @@ Bugs fixed * #6046: LaTeX: ``TypeError`` is raised when invalid latex_elements given * #6019: imgconverter: Including multipage PDF fails * #6047: autodoc: ``autofunction`` emits a warning for method objects +* #6028: graphviz: Ensure the graphviz filenames are reproducible Testing -------- diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py index b62d8025491..2971f40162f 100644 --- a/sphinx/ext/graphviz.py +++ b/sphinx/ext/graphviz.py @@ -194,9 +194,7 @@ def run(self): node = graphviz() node['code'] = '%s %s {\n%s\n}\n' % \ (self.name, self.arguments[0], '\n'.join(self.content)) - node['options'] = { - 'docname': path.splitext(self.state.document.current_source)[0], - } + node['options'] = {'docname': self.env.docname} if 'graphviz_dot' in self.options: node['options']['graphviz_dot'] = self.options['graphviz_dot'] if 'alt' in self.options: