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
This commit is contained in:
Cédric Krier committed 2024-09-24 10:19:57 +02:00
1 parent 19153c0ab5
commit 3d8fcb97bd
1 file changed
+1 -1
@@ -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'),
}