Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 b7535bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -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)
Expand Down
7 changes: 6 additions & 1 deletion nikola/plugins/command/github_deploy.py
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b7535bc

Please sign in to comment.