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/command/install_theme.py | |
| parent | 58c4878526dec5510f23c812274686787d8724ba (diff) | |
Imported Upstream version 7.1.0upstream/7.1.0
Diffstat (limited to 'nikola/plugins/command/install_theme.py')
| -rw-r--r-- | nikola/plugins/command/install_theme.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/nikola/plugins/command/install_theme.py b/nikola/plugins/command/install_theme.py index 859bd56..5397772 100644 --- a/nikola/plugins/command/install_theme.py +++ b/nikola/plugins/command/install_theme.py @@ -26,10 +26,9 @@ from __future__ import print_function import os -import codecs +import io import json import shutil -from io import BytesIO import pygments from pygments.lexers import PythonLexer @@ -137,7 +136,7 @@ class CommandInstallTheme(Command): if name in data: utils.makedirs(self.output_dir) LOGGER.info('Downloading: ' + data[name]) - zip_file = BytesIO() + zip_file = io.BytesIO() zip_file.write(requests.get(data[name]).content) LOGGER.info('Extracting: {0} into themes'.format(name)) utils.extract_all(zip_file) @@ -161,7 +160,7 @@ class CommandInstallTheme(Command): if os.path.exists(confpypath): LOGGER.notice('This theme has a sample config file. Integrate it with yours in order to make this theme work!') print('Contents of the conf.py.sample file:\n') - with codecs.open(confpypath, 'rb', 'utf-8') as fh: + with io.open(confpypath, 'r', encoding='utf-8') as fh: if self.site.colorful: print(indent(pygments.highlight( fh.read(), PythonLexer(), TerminalFormatter()), |
