From 3d8fcb97bde0de57b77258a54f68ab97a118fb65 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 --- 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 fe816e228c..faa27e9621 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(), 'fallback_application_name': os.environ.get( 'TRYTOND_APPNAME', 'trytond'), }