Skip to content
Permalink
Browse files

Fix #2223 -- encode commands in github_deploy

Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 22, 2016
1 parent a020b67 commit b7535bcea08ed24a38ee399f7e6970093c531831
Showing with 7 additions and 1 deletion.
  1. +1 −0 CHANGES.txt
  2. +6 −1 nikola/plugins/command/github_deploy.py
@@ -14,6 +14,7 @@ Features
Bugfixes
--------

* Fix ``github_deploy`` on Windows (Issue #2223)
* Don’t attempt to create redirects for URLs with query strings in
WordPress imports if the site is in a subdirectory (Issue #2224)
* Avoid some random file rebuilds (Issue #2220)
@@ -49,7 +49,10 @@ def uni_check_output(*args, **kwargs):
def check_ghp_import_installed():
"""Check if ghp-import is installed."""
try:
subprocess.check_output(['ghp-import', '-h'])
if os.name == 'nt':
subprocess.check_output([b'ghp-import', b'-h'])
else:
subprocess.check_output(['ghp-import', '-h'])
except OSError:
# req_missing defaults to `python=True` — and it’s meant to be like this.
# `ghp-import` is installed via pip, but the only way to use it is by executing the script it installs.
@@ -109,6 +112,8 @@ def _execute(self, options, args):
def _run_command(self, command, xfail=False):
"""Run a command that may or may not fail."""
self.logger.info("==> {0}".format(command))
if os.name == 'nt':
command = [i.encode('ascii', errors='replace') for i in command]
try:
subprocess.check_call(command)
return 0

0 comments on commit b7535bc

Please sign in to comment.
You can’t perform that action at this time.