Skip to content

Commit

Permalink
fix a strange bug
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Feb 13, 2015
1 parent 8061820 commit f1925b4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion nikola/plugins/compile/rest/__init__.py
Expand Up @@ -41,7 +41,7 @@
has_docutils = False

from nikola.plugin_categories import PageCompiler
from nikola.utils import get_logger, makedirs, req_missing, write_metadata
from nikola.utils import unicode_str, get_logger, makedirs, req_missing, write_metadata


class CompileRest(PageCompiler):
Expand Down Expand Up @@ -97,6 +97,10 @@ def compile_html(self, source, dest, is_two_file=True):
'math_output': 'mathjax',
'template': default_template_path,
}, logger=self.logger, source_path=source, l_add_ln=add_ln)
if not isinstance(output, unicode_str):
# To prevent some weird bugs here or there.
# Original issue: empty files. `output` became a bytestring.
output = output.decode('utf-8')
out_file.write(output)
deps_path = dest + '.dep'
if deps.list:
Expand Down

0 comments on commit f1925b4

Please sign in to comment.