Skip to content

Commit

Permalink
Pass LC and LANG envvars to pg_ctl calls - closes #343
Browse files Browse the repository at this point in the history
  • Loading branch information
fizyk committed Jul 18, 2024
1 parent 6c2e628 commit e70d7c7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions newsfragments/343.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fixed a long-standing bug, where calls to pg_ctl weren't getting `LC_*` and `LANG` envvars,
which caused issues on some systems not recognizing --auth parameter.
6 changes: 4 additions & 2 deletions pytest_postgresql/executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,13 @@ def init_directory(self) -> None:
password_file.write(password)
password_file.flush()
init_directory += ["-o", " ".join(options)]
subprocess.check_output(init_directory)
# Passing envvars to command to avoid weird MacOs error.
subprocess.check_output(init_directory, env=self._envvars)
else:
options += ["--auth=trust"]
init_directory += ["-o", " ".join(options)]
subprocess.check_output(init_directory)
# Passing envvars to command to avoid weird MacOs error.
subprocess.check_output(init_directory, env=self._envvars)

self._directory_initialised = True

Expand Down

0 comments on commit e70d7c7

Please sign in to comment.