diff options
| author | DasIch <dasdasich@gmail.com> | 2010-06-17 05:26:19 +0200 |
|---|---|---|
| committer | DasIch <dasdasich@gmail.com> | 2010-06-17 05:26:19 +0200 |
| commit | 3b0bc3f3f1d1e196d18c5bc27a9a4e2516bf64d5 (patch) | |
| tree | c315727f456c4c89b03584a11b02f311454fd933 /sphinx/util/__init__.py | |
| parent | 1db6898d76a8e7b567b60061eb089a96196b5951 (diff) | |
| download | sphinx-3b0bc3f3f1d1e196d18c5bc27a9a4e2516bf64d5.tar.gz | |
Decode templates using utf-8 as jinja2 requires that for python3. This change will very likely cause problems for some people
Diffstat (limited to 'sphinx/util/__init__.py')
| -rw-r--r-- | sphinx/util/__init__.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index 2ef420ed..ec48009f 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -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() |
