mirror of
https://abf.rosa.ru/djam/abf-console-client-src.git
synced 2025-02-23 18:02:50 +00:00
Fix possible problems with launch of 'abf build' in non-ascii locale
This commit is contained in:
parent
2978be5d25
commit
77198a1286
1 changed files with 8 additions and 3 deletions
|
@ -40,8 +40,10 @@ class ReturnCodeNotZero(Exception):
|
|||
|
||||
def get_project_name(path=None):
|
||||
try:
|
||||
# TODO: Force C locale?
|
||||
output, ret_code = execute_command(['git', 'remote', 'show', 'origin', '-n'], cwd=path)
|
||||
# Force C locale - we will analyze output of "git" command
|
||||
e = os.environ.copy()
|
||||
e["LC_ALL"] = "C"
|
||||
output, ret_code = execute_command(['git', 'remote', 'show', 'origin', '-n'], cwd=path, env=e)
|
||||
|
||||
for line in output.split('\n'):
|
||||
if line.startswith(' Fetch URL:') and 'abf' in line:
|
||||
|
@ -345,9 +347,11 @@ def pack_project(root_path):
|
|||
|
||||
|
||||
|
||||
def execute_command(command, shell=False, cwd=None, timeout=0, raiseExc=True, print_to_stdout=False, exit_on_error=False):
|
||||
def execute_command(command, shell=False, cwd=None, timeout=0, raiseExc=True, print_to_stdout=False, exit_on_error=False, env=[]):
|
||||
output = ""
|
||||
start = time.time()
|
||||
if not env:
|
||||
env = os.environ
|
||||
try:
|
||||
child = None
|
||||
log.debug(_("Executing command: %s") % command)
|
||||
|
@ -358,6 +362,7 @@ def execute_command(command, shell=False, cwd=None, timeout=0, raiseExc=True, pr
|
|||
stdin=open("/dev/null", "r"),
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.PIPE,
|
||||
env=env,
|
||||
cwd=cwd
|
||||
)
|
||||
# use select() to poll for output so we dont block
|
||||
|
|
Loading…
Add table
Reference in a new issue