From f07fa9b37721a6da96394fc7017d2252df375c33 Mon Sep 17 00:00:00 2001 From: Jakob Haufe Date: Thu, 19 Dec 2024 15:44:05 +0100 Subject: [PATCH] Don't break socket connections for postgres Also, use dict.get() for default values. --- dbbackup/db/postgresql.py | 8 ++++---- docs/changelog.rst | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dbbackup/db/postgresql.py b/dbbackup/db/postgresql.py index 1dd737a..9619845 100644 --- a/dbbackup/db/postgresql.py +++ b/dbbackup/db/postgresql.py @@ -8,10 +8,10 @@ def create_postgres_uri(self): - host = self.settings.get("HOST") or "localhost" - dbname = self.settings.get("NAME") or "" - user = quote(self.settings.get("USER") or "") - password = self.settings.get("PASSWORD") or "" + host = self.settings.get("HOST", "localhost") + dbname = self.settings.get("NAME", "") + user = quote(self.settings.get("USER", "")) + password = self.settings.get("PASSWORD", "") password = f":{quote(password)}" if password else "" if not user: password = "" diff --git a/docs/changelog.rst b/docs/changelog.rst index 2715009..6bf536e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,7 +4,7 @@ Changelog Unreleased ---------- -* Nothing (yet)! +* Empty string as HOST for postgres unix domain socket connection is now supported. 4.2.1 (2024-08-23) ----------