Fixed an issue where backup does not work due to parameter 'preexec_fn' no longer being supported. Fixes #7580

This commit is contained in:
Yogesh Mahajan 2022-09-02 13:12:58 +05:30 committed by Akshay Joshi
parent 5625fe0969
commit 9a317f3ba6
2 changed files with 5 additions and 2 deletions

View File

@ -18,5 +18,6 @@ Housekeeping
Bug fixes
*********
| `Issue #7580 <https://redmine.postgresql.org/issues/7580>`_ - Fixed an issue where backup does not work due to parameter 'preexec_fn' no longer being supported.
| `Issue #7644 <https://redmine.postgresql.org/issues/7644>`_ - Ensure that the dump servers functionality works from setup.py.
| `Issue #7646 <https://redmine.postgresql.org/issues/7646>`_ - Ensure that the Import/Export server menu option is visible.

View File

@ -266,6 +266,8 @@ class BatchProcess(object):
interpreter = self.get_windows_interpreter(paths)
else:
interpreter = sys.executable
if interpreter.endswith('uwsgi'):
interpreter = interpreter.split('uwsgi')[0] + 'python'
return interpreter if interpreter else 'python'
@ -335,7 +337,7 @@ class BatchProcess(object):
else:
p = Popen(
cmd, close_fds=True, stdout=None, stderr=None, stdin=None,
preexec_fn=self.preexec_function, env=env
start_new_session=True, env=env
)
self.ecode = p.poll()
@ -371,7 +373,7 @@ class BatchProcess(object):
"""
p = Popen(
cmd, close_fds=True, stdout=PIPE, stderr=PIPE, stdin=None,
preexec_fn=self.preexec_function, env=env
start_new_session=True, env=env
)
output, errors = p.communicate()