Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 3f7a1b7

Browse files
committedJan 22, 2016
Fix #2223 -- encode commands in github_deploy
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
1 parent 66d1970 commit 3f7a1b7

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Features
1414
Bugfixes
1515
--------
1616

17+
* Fix ``github_deploy`` on Windows (Issue #2223)
1718
* Avoid some random file rebuilds (Issue #2220)
1819
* Honor ``MATHJAX_CONFIG``
1920
* Display tags and archives in a unified format, with the date on the

‎nikola/plugins/command/github_deploy.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,10 @@ def uni_check_output(*args, **kwargs):
4949
def check_ghp_import_installed():
5050
"""Check if ghp-import is installed."""
5151
try:
52-
subprocess.check_output(['ghp-import', '-h'])
52+
if os.name == 'nt':
53+
subprocess.check_output([b'ghp-import', b'-h'])
54+
else:
55+
subprocess.check_output(['ghp-import', '-h'])
5356
except OSError:
5457
# req_missing defaults to `python=True` — and it’s meant to be like this.
5558
# `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):
109112
def _run_command(self, command, xfail=False):
110113
"""Run a command that may or may not fail."""
111114
self.logger.info("==> {0}".format(command))
115+
if os.name == 'nt':
116+
command = [i.encode('ascii', errors='replace') for i in command]
112117
try:
113118
subprocess.check_call(command)
114119
return 0

0 commit comments

Comments
 (0)
Please sign in to comment.