2
0
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:
Achilles Rasquinha 2018-03-12 18:27:52 +05:30 committed by GitHub
commit aa3b08047c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -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

View File

@ -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 []

View File

@ -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
View File

@ -0,0 +1 @@
bench.patches.v3.deprecate_old_config