mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Decode templates using utf-8 as jinja2 requires that for python3. This change will very likely cause problems for some people
This commit is contained in:
parent
7add175598
commit
9e56fac893
@ -18,6 +18,7 @@ import tempfile
|
||||
import posixpath
|
||||
import traceback
|
||||
from os import path
|
||||
from codecs import open
|
||||
|
||||
import docutils
|
||||
from docutils.utils import relative_path
|
||||
@ -140,8 +141,8 @@ def copy_static_entry(source, targetdir, builder, context={},
|
||||
target = path.join(targetdir, path.basename(source))
|
||||
if source.lower().endswith('_t') and builder.templates:
|
||||
# templated!
|
||||
fsrc = open(source, 'rb')
|
||||
fdst = open(target[:-2], 'wb')
|
||||
fsrc = open(source, 'r', encoding='utf-8')
|
||||
fdst = open(target[:-2], 'w', encoding='utf-8')
|
||||
fdst.write(builder.templates.render_string(fsrc.read(), context))
|
||||
fsrc.close()
|
||||
fdst.close()
|
||||
|
Loading…
Reference in New Issue
Block a user