diff options
| author | 2014-10-21 10:33:15 -0300 | |
|---|---|---|
| committer | 2014-10-21 10:33:15 -0300 | |
| commit | 5ec02211214350ee558fd9f6bb052264fd24f75e (patch) | |
| tree | b61e8c61a95d18a91d053e71dcbd7b30e47552a1 /nikola/plugins/task/copy_assets.py | |
| parent | 58c4878526dec5510f23c812274686787d8724ba (diff) | |
Imported Upstream version 7.1.0upstream/7.1.0
Diffstat (limited to 'nikola/plugins/task/copy_assets.py')
| -rw-r--r-- | nikola/plugins/task/copy_assets.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nikola/plugins/task/copy_assets.py b/nikola/plugins/task/copy_assets.py index 4801347..29aa083 100644 --- a/nikola/plugins/task/copy_assets.py +++ b/nikola/plugins/task/copy_assets.py @@ -24,7 +24,9 @@ # OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -import codecs +from __future__ import unicode_literals + +import io import os from nikola.plugin_categories import Task @@ -82,13 +84,13 @@ class CopyAssets(Task): from pygments.formatters import get_formatter_by_name formatter = get_formatter_by_name('html', style=kw["code_color_scheme"]) utils.makedirs(os.path.dirname(code_css_path)) - with codecs.open(code_css_path, 'wb+', 'utf8') as outf: + with io.open(code_css_path, 'w+', encoding='utf8') as outf: outf.write(kw["code.css_head"]) outf.write(formatter.get_style_defs(kw["code.css_selectors"])) outf.write(kw["code.css_close"]) if os.path.exists(code_css_path): - with codecs.open(code_css_path, 'r', 'utf-8') as fh: + with io.open(code_css_path, 'r', encoding='utf-8') as fh: testcontents = fh.read(len(kw["code.css_head"])) == kw["code.css_head"] else: testcontents = False |
