From ad9869f5b51ff521884dc86a8be6432b64faa8f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 24 Sep 2024 10:19:57 +0200 Subject: [PATCH] Start PostgreSQL URI path with a '/' Since https://github.com/python/cpython/issues/76960 if the path of the URI does not start with a '/', the netloc is removed. Closes #13543 (grafted from 6d420b9f4bffc77dc599abff4b7f8e17a061542d) --HG-- branch : 6.0 --- trytond/trytond/backend/postgresql/database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/trytond/trytond/backend/postgresql/database.py b/trytond/trytond/backend/postgresql/database.py index 4e1c61aaf9..bcbf462b1c 100644 --- a/trytond/trytond/backend/postgresql/database.py +++ b/trytond/trytond/backend/postgresql/database.py @@ -249,7 +249,7 @@ class Database(DatabaseInterface): if uri.path and uri.path != '/': warnings.warn("The path specified in the URI will be overridden") params = { - 'dsn': uri._replace(path=name).geturl(), + 'dsn': uri._replace(path='/' + name).geturl(), } return params