diff options
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()), |
