Fixed an issue where the background job creation fails if there is only a version-specific python binary available in PATH. Fixes #5480

This commit is contained in:
Nagesh Dhope
2020-05-06 12:38:06 +05:30
committed by Akshay Joshi
parent 943495de31
commit f61448eea2
2 changed files with 5 additions and 2 deletions

View File

@@ -280,7 +280,9 @@ class BatchProcess(object):
# anyway be the redundant value in paths.
if not current_app.PGADMIN_RUNTIME:
paths.insert(0, os.path.join(u(sys.prefix), u'bin'))
interpreter = which(u'python', paths)
python_binary_name = 'python{0}'.format(sys.version_info[0]) \
if sys.version_info[0] >= 3 else 'python'
interpreter = which(u(python_binary_name), paths)
p = None
cmd = [