summaryrefslogtreecommitdiff
path: root/sphinx/builders/xml.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/builders/xml.py')
-rw-r--r--sphinx/builders/xml.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/sphinx/builders/xml.py b/sphinx/builders/xml.py
index 6198532c9..03aefe006 100644
--- a/sphinx/builders/xml.py
+++ b/sphinx/builders/xml.py
@@ -9,7 +9,6 @@
:license: BSD, see LICENSE for details.
"""
-import codecs
from os import path
from docutils import nodes
@@ -54,8 +53,7 @@ class XMLBuilder(Builder):
if docname not in self.env.all_docs:
yield docname
continue
- targetname = self.env.doc2path(docname, self.outdir,
- self.out_suffix)
+ targetname = path.join(self.outdir, docname + self.out_suffix)
try:
targetmtime = path.getmtime(targetname)
except Exception:
@@ -95,7 +93,7 @@ class XMLBuilder(Builder):
outfilename = path.join(self.outdir, os_path(docname) + self.out_suffix)
ensuredir(path.dirname(outfilename))
try:
- with codecs.open(outfilename, 'w', 'utf-8') as f: # type: ignore
+ with open(outfilename, 'w', encoding='utf-8') as f: # type: ignore
f.write(self.writer.output)
except (IOError, OSError) as err:
logger.warning(__("error writing file %s: %s"), outfilename, err)