diff --git a/tools/minify-js b/tools/minify-js index a6a48e1a9f..b61f426385 100755 --- a/tools/minify-js +++ b/tools/minify-js @@ -45,11 +45,11 @@ def get_changed_source_files(other_checkout): try: git_dir = os.path.join(other_checkout, '.git') old_commit_sha1 = subprocess.check_output(['git', 'rev-parse', 'HEAD'], - env={'GIT_DIR': git_dir}) + env={'GIT_DIR': git_dir}, universal_newlines=True) old_commit_sha1 = old_commit_sha1.rstrip() git_diff = subprocess.check_output(['git', 'diff', '--name-only', - old_commit_sha1]) + old_commit_sha1], universal_newlines=True) except subprocess.CalledProcessError: # If git returned an error, assume we can't reuse any files, and # regenerate everything. @@ -130,5 +130,5 @@ for js_group, filespec in six.iteritems(JS_SPECS): js = subprocess.check_output(cmd, shell=True) # Write out the JS - with open(out_file, 'w') as fp: + with open(out_file, 'wb') as fp: fp.write(js) diff --git a/tools/post-receive b/tools/post-receive index 4b754c2717..179ac7cb4d 100755 --- a/tools/post-receive +++ b/tools/post-receive @@ -33,7 +33,7 @@ import os import sys import subprocess sys.path.append(os.path.join(os.path.dirname(__file__), '..')) -from zerver.lib.str_utils import force_str +from zerver.lib.str_utils import force_str, force_bytes from zulip_tools import ENDC, FAIL, subprocess_text_output def update_deployment(server, refname): @@ -58,7 +58,7 @@ for ln in sys.stdin: if refname in deployments: p = subprocess.Popen("/home/zulip/zulip/bots/githook-post-receive", stdin=subprocess.PIPE) - p.communicate(input=ln) + p.communicate(input=force_bytes(ln)) if deployments[refname]: server, branch = deployments[refname]