aboutsummaryrefslogtreecommitdiffstats
path: root/nikola/plugins/compile/markdown/__init__.py
diff options
context:
space:
mode:
authorLibravatarAgustin Henze <tin@sluc.org.ar>2014-10-21 10:33:15 -0300
committerLibravatarAgustin Henze <tin@sluc.org.ar>2014-10-21 10:33:15 -0300
commit5ec02211214350ee558fd9f6bb052264fd24f75e (patch)
treeb61e8c61a95d18a91d053e71dcbd7b30e47552a1 /nikola/plugins/compile/markdown/__init__.py
parent58c4878526dec5510f23c812274686787d8724ba (diff)
Imported Upstream version 7.1.0upstream/7.1.0
Diffstat (limited to 'nikola/plugins/compile/markdown/__init__.py')
-rw-r--r--nikola/plugins/compile/markdown/__init__.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nikola/plugins/compile/markdown/__init__.py b/nikola/plugins/compile/markdown/__init__.py
index 4182626..47c7c9b 100644
--- a/nikola/plugins/compile/markdown/__init__.py
+++ b/nikola/plugins/compile/markdown/__init__.py
@@ -28,7 +28,7 @@
from __future__ import unicode_literals
-import codecs
+import io
import os
import re
@@ -70,8 +70,8 @@ class CompileMarkdown(PageCompiler):
req_missing(['markdown'], 'build this site (compile Markdown)')
makedirs(os.path.dirname(dest))
self.extensions += self.site.config.get("MARKDOWN_EXTENSIONS")
- with codecs.open(dest, "w+", "utf8") as out_file:
- with codecs.open(source, "r", "utf8") as in_file:
+ with io.open(dest, "w+", encoding="utf8") as out_file:
+ with io.open(source, "r", encoding="utf8") as in_file:
data = in_file.read()
if not is_two_file:
data = re.split('(\n\n|\r\n\r\n)', data, maxsplit=1)[-1]
@@ -90,7 +90,7 @@ class CompileMarkdown(PageCompiler):
makedirs(os.path.dirname(path))
if not content.endswith('\n'):
content += '\n'
- with codecs.open(path, "wb+", "utf8") as fd:
+ with io.open(path, "w+", encoding="utf8") as fd:
if onefile:
fd.write('<!-- \n')
fd.write(write_metadata(metadata))