Repository: getnikola/nikola

Issue:
github_deploy command not working on Python 3.4.0
Ubuntu 14.04:

``` pytb
(blog)kzhang@vm1404:~/projects/blog/blog$ nikola github_deploy
Traceback (most recent call last):
  File "/home/kzhang/projects/blog/lib/python3.4/site-packages/doit/doit_cmd.py", line 120, in run
    return command.parse_execute(args)
  File "/home/kzhang/projects/blog/lib/python3.4/site-packages/doit/cmd_base.py", line 78, in parse_execute
    return self.execute(params, args)
  File "/home/kzhang/projects/blog/lib/python3.4/site-packages/nikola/plugin_categories.py", line 98, in execute
    self._execute(options, args)
  File "/home/kzhang/projects/blog/lib/python3.4/site-packages/nikola/plugins/command/github_deploy.py", line 92, in _execute
    self._ensure_git_repo()
  File "/home/kzhang/projects/blog/lib/python3.4/site-packages/nikola/plugins/command/github_deploy.py", line 226, in _ensure_git_repo
    if self._remote_name not in remotes:
TypeError: Type str doesn't support the buffer API
```



Discussion:

Resolving patch:
diff --git a/nikola/plugins/command/github_deploy.py b/nikola/plugins/command/github_deploy.py
--- a/nikola/plugins/command/github_deploy.py
+++ b/nikola/plugins/command/github_deploy.py
@@ -38,6 +38,11 @@
 from nikola import __version__
 
 
+def uni_check_output(*args, **kwargs):
+    o = subprocess.check_output(*args, **kwargs)
+    return o.decode('utf-8')
+
+
 class CommandGitHubDeploy(Command):
     """ Deploy site to GitHub pages. """
     name = 'github_deploy'
@@ -122,7 +127,7 @@ def _commit_and_push(self):
         source = self._source_branch
         remote = self._remote_name
 
-        source_commit = subprocess.check_output(['git', 'rev-parse', source])
+        source_commit = uni_check_output(['git', 'rev-parse', source])
         commit_message = (
             'Nikola auto commit.\n\n'
             'Source commit: %s'
@@ -213,7 +218,7 @@ def _ensure_git_repo(self):
         """
 
         try:
-            remotes = subprocess.check_output(['git', 'remote'])
+            remotes = uni_check_output(['git', 'remote'])
         except subprocess.CalledProcessError as e:
             self.logger.notice('github_deploy needs a git repository!')
             sys.exit(e.returncode)
@@ -237,7 +242,7 @@ def _exit_if_output_committed(self):
         subprocess.check_call(['git', 'checkout', source])
 
         output_folder = self.site.config['OUTPUT_FOLDER']
-        output_log = subprocess.check_output(
+        output_log = uni_check_output(
             ['git', 'ls-files', '--', output_folder]
         )
 
@@ -251,9 +256,9 @@ def _exit_if_output_committed(self):
     def _prompt_continue(self):
         """ Show uncommitted changes, and ask if user wants to continue. """
 
-        changes = subprocess.check_output(['git', 'status', '--porcelain'])
+        changes = uni_check_output(['git', 'status', '--porcelain'])
         if changes.strip():
-            changes = subprocess.check_output(['git', 'status']).strip()
+            changes = uni_check_output(['git', 'status']).strip()
             message = (
                 "You have the following changes:\n%s\n\n"
                 "Anything not committed, and unknown to Nikola may be lost, "


Test patch: