mirror of
https://github.com/frappe/bench.git
synced 2024-11-14 09:14:04 +00:00
Merge pull request #597 from frappe/py3-dev
fixes for encoding decoding
This commit is contained in:
commit
aa3b08047c
@ -172,6 +172,7 @@ def pull_all_apps(bench_path='.', reset=False):
|
||||
app_dir = get_repo_dir(app, bench_path=bench_path)
|
||||
if os.path.exists(os.path.join(app_dir, '.git')):
|
||||
out = subprocess.check_output(["git", "status"], cwd=app_dir)
|
||||
out = out.decode('utf-8')
|
||||
if not re.search(r'nothing to commit, working (directory|tree) clean', out):
|
||||
print('''
|
||||
|
||||
@ -234,6 +235,7 @@ def get_remote(app, bench_path='.'):
|
||||
repo_dir = get_repo_dir(app, bench_path=bench_path)
|
||||
contents = subprocess.check_output(['git', 'remote', '-v'], cwd=repo_dir,
|
||||
stderr=subprocess.STDOUT)
|
||||
contents = contents.decode('utf-8')
|
||||
if re.findall('upstream[\s]+', contents):
|
||||
remote = 'upstream'
|
||||
else:
|
||||
@ -273,6 +275,7 @@ def get_upstream_version(app, branch=None, bench_path='.'):
|
||||
branch = get_current_branch(app, bench_path=bench_path)
|
||||
try:
|
||||
contents = subprocess.check_output(['git', 'show', 'upstream/{branch}:{app}/__init__.py'.format(branch=branch, app=app)], cwd=repo_dir, stderr=subprocess.STDOUT)
|
||||
contents = contents.decode('utf-8')
|
||||
except subprocess.CalledProcessError as e:
|
||||
if b"Invalid object" in e.output:
|
||||
return None
|
||||
|
@ -96,7 +96,7 @@ def get_frappe_commands(bench_path='.'):
|
||||
return []
|
||||
try:
|
||||
output = get_cmd_output("{python} -m frappe.utils.bench_helper get-frappe-commands".format(python=python), cwd=sites_path)
|
||||
output = output.decode('utf-8')
|
||||
# output = output.decode('utf-8')
|
||||
return json.loads(output)
|
||||
except subprocess.CalledProcessError:
|
||||
return []
|
||||
|
@ -373,7 +373,9 @@ def check_git_for_shallow_clone():
|
||||
|
||||
def get_cmd_output(cmd, cwd='.'):
|
||||
try:
|
||||
return subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, 'wb')).strip()
|
||||
output = subprocess.check_output(cmd, cwd=cwd, shell=True, stderr=open(os.devnull, 'wb')).strip()
|
||||
output = output.decode('utf-8')
|
||||
return output
|
||||
except subprocess.CalledProcessError as e:
|
||||
if e.output:
|
||||
print(e.output)
|
||||
|
1
patches.txt
Normal file
1
patches.txt
Normal file
@ -0,0 +1 @@
|
||||
bench.patches.v3.deprecate_old_config
|
Loading…
Reference in New Issue
Block a user