Skip to content

Commit

Permalink
postgresql: fix encoding of pgctl path
Browse files Browse the repository at this point in the history
This should be a regular string and not bytes. Otherwise in case of error
(pg_ctl not found), this happens:
  ERROR [pifpaf] sequence item 0: expected str instance, bytes found

Closes #118
  • Loading branch information
jd committed Jan 2, 2019
1 parent c32baff commit da19b23
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pifpaf/drivers/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def _setUp(self):
self.putenv("PGDATA", self.tempdir, True)
self.putenv("PGDATABASE", "postgres", True)
_, pgbindir = self._exec(["pg_config", "--bindir"], stdout=True)
pgctl = os.path.join(pgbindir.strip(), b"pg_ctl")
pgctl = os.path.join(pgbindir.strip().decode(), "pg_ctl")
self._exec([pgctl, "-o", "'-A trust'", "initdb"])
if not self.sync:
cfgfile = os.path.join(self.tempdir, 'postgresql.conf')
Expand Down

0 comments on commit da19b23

Please sign in to comment.