mirror of
https://github.com/zulip/zulip.git
synced 2025-11-15 19:31:58 +00:00
tools/: Make subprocess calls unicode-aware.
This commit is contained in:
committed by
Tim Abbott
parent
e0dbaf1031
commit
97d877f49e
@@ -45,11 +45,11 @@ def get_changed_source_files(other_checkout):
|
|||||||
try:
|
try:
|
||||||
git_dir = os.path.join(other_checkout, '.git')
|
git_dir = os.path.join(other_checkout, '.git')
|
||||||
old_commit_sha1 = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
|
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()
|
old_commit_sha1 = old_commit_sha1.rstrip()
|
||||||
|
|
||||||
git_diff = subprocess.check_output(['git', 'diff', '--name-only',
|
git_diff = subprocess.check_output(['git', 'diff', '--name-only',
|
||||||
old_commit_sha1])
|
old_commit_sha1], universal_newlines=True)
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
# If git returned an error, assume we can't reuse any files, and
|
# If git returned an error, assume we can't reuse any files, and
|
||||||
# regenerate everything.
|
# regenerate everything.
|
||||||
@@ -130,5 +130,5 @@ for js_group, filespec in six.iteritems(JS_SPECS):
|
|||||||
js = subprocess.check_output(cmd, shell=True)
|
js = subprocess.check_output(cmd, shell=True)
|
||||||
|
|
||||||
# Write out the JS
|
# Write out the JS
|
||||||
with open(out_file, 'w') as fp:
|
with open(out_file, 'wb') as fp:
|
||||||
fp.write(js)
|
fp.write(js)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
|
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
|
from zulip_tools import ENDC, FAIL, subprocess_text_output
|
||||||
|
|
||||||
def update_deployment(server, refname):
|
def update_deployment(server, refname):
|
||||||
@@ -58,7 +58,7 @@ for ln in sys.stdin:
|
|||||||
if refname in deployments:
|
if refname in deployments:
|
||||||
p = subprocess.Popen("/home/zulip/zulip/bots/githook-post-receive",
|
p = subprocess.Popen("/home/zulip/zulip/bots/githook-post-receive",
|
||||||
stdin=subprocess.PIPE)
|
stdin=subprocess.PIPE)
|
||||||
p.communicate(input=ln)
|
p.communicate(input=force_bytes(ln))
|
||||||
|
|
||||||
if deployments[refname]:
|
if deployments[refname]:
|
||||||
server, branch = deployments[refname]
|
server, branch = deployments[refname]
|
||||||
|
|||||||
Reference in New Issue
Block a user