From 0d8adf9ced6bbcb161340b555141a6e8d9eda6e7 Mon Sep 17 00:00:00 2001 From: Yogesh Mahajan Date: Mon, 6 Nov 2023 18:02:52 +0530 Subject: [PATCH] Ensure backup/restore/maintenance works with invalid pgpass file parameter. #6820 --- web/pgadmin/misc/bgprocess/processes.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/pgadmin/misc/bgprocess/processes.py b/web/pgadmin/misc/bgprocess/processes.py index f7d9e3554..662674df5 100644 --- a/web/pgadmin/misc/bgprocess/processes.py +++ b/web/pgadmin/misc/bgprocess/processes.py @@ -309,6 +309,8 @@ class BatchProcess: if self.env: env.update(self.env) + current_app.logger.debug(self.env) + if cb is not None: cb(env) if os.name == 'nt': @@ -839,8 +841,10 @@ class BatchProcess: isinstance(self.manager_obj.connection_params, dict) and \ 'passfile' in self.manager_obj.connection_params and \ self.manager_obj.connection_params['passfile']: - self.env['PGPASSFILE'] = get_complete_file_path( + pgpasspath = get_complete_file_path( self.manager_obj.connection_params['passfile']) + if pgpasspath is not None: + self.env['PGPASSFILE'] = pgpasspath # Check for connection timeout and if it is greater than 0 then # set the environment variable PGCONNECT_TIMEOUT.