From f61448eea29bd20004b97d80e4634befd2d5d262 Mon Sep 17 00:00:00 2001 From: Nagesh Dhope Date: Wed, 6 May 2020 12:38:06 +0530 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20where=20the=20background?= =?UTF-8?q?=20job=20creation=20fails=C2=A0if=20there=20is=20only=20a=20ver?= =?UTF-8?q?sion-specific=20python=20binary=20available=20in=20PATH.=20Fixe?= =?UTF-8?q?s=20#5480?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/en_US/release_notes_4_22.rst | 3 ++- web/pgadmin/misc/bgprocess/processes.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/en_US/release_notes_4_22.rst b/docs/en_US/release_notes_4_22.rst index dfbf9210c..4bc34e2c4 100644 --- a/docs/en_US/release_notes_4_22.rst +++ b/docs/en_US/release_notes_4_22.rst @@ -27,4 +27,5 @@ Bug fixes | `Issue #5449 `_ - Fixed an issue while comparing the two identical schemas using the schema diff tool. | `Issue #5466 `_ - Correct ipv4 "all interfaces" address in the container docs, per Frank Limpert. | `Issue #5469 `_ - Fixed an issue where select2 hover is inconsistent for the SSL field in create server dialog. -| `Issue #5473 `_ - Fixed post-login redirect location when running in server mode under a non-default root. \ No newline at end of file +| `Issue #5473 `_ - Fixed post-login redirect location when running in server mode under a non-default root. +| `Issue #5480 `_ - Fixed an issue where the background job creation fails if there is only a version-specific python binary available in PATH. \ No newline at end of file diff --git a/web/pgadmin/misc/bgprocess/processes.py b/web/pgadmin/misc/bgprocess/processes.py index 048ce21c1..f2be19f9d 100644 --- a/web/pgadmin/misc/bgprocess/processes.py +++ b/web/pgadmin/misc/bgprocess/processes.py @@ -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 = [