changeset 27b828ae299a in trytond:default
details: https://hg.tryton.org/trytond?cmd=changeset&node=27b828ae299a
description:
Set backend scheme to uses netloc
The netloc is required in dsn.
issue10101
diffstat:
trytond/config.py | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diffs (15 lines):
diff -r ec2fc6da64aa -r 27b828ae299a trytond/config.py
--- a/trytond/config.py Tue Apr 13 01:41:30 2021 +0200
+++ b/trytond/config.py Tue Apr 13 01:43:52 2021 +0200
@@ -12,6 +12,11 @@
'parse_listen', 'parse_uri']
logger = logging.getLogger(__name__)
+# Needed so urlunsplit to always set netloc
+for backend_name in ['postgresql', 'sqlite']:
+ if backend_name not in urllib.parse.uses_netloc:
+ urllib.parse.uses_netloc.append(backend_name)
+
def get_hostname(netloc):
if '[' in netloc and ']' in netloc: