diff sat/tools/common/uri.py @ 3661:cbb988a6f507

merge bookmark `@`
author Goffi <goffi@goffi.org>
date Wed, 08 Sep 2021 11:20:37 +0200
parents cc3b453670a2
children 67fc066ed2cd
line wrap: on
line diff
--- a/sat/tools/common/uri.py	Wed Sep 01 15:25:02 2021 +0200
+++ b/sat/tools/common/uri.py	Wed Sep 08 11:20:37 2021 +0200
@@ -19,6 +19,7 @@
 
 """ XMPP uri parsing tools """
 
+import sys
 import urllib.parse
 import urllib.request, urllib.parse, urllib.error
 
@@ -53,7 +54,13 @@
     if query_end == -1 or "=" in query_type:
         raise ValueError("no query type, invalid XMPP URI")
 
-    pairs = urllib.parse.parse_qs(uri_split.geturl())
+    if sys.version_info >= (3, 9):
+        # parse_qs behaviour has been modified in Python 3.9, ";" is not understood as a
+        # parameter separator anymore but the "separator" argument has been added to
+        # change it.
+        pairs = urllib.parse.parse_qs(uri_split.geturl(), separator=";")
+    else:
+        pairs = urllib.parse.parse_qs(uri_split.geturl())
     for k, v in list(pairs.items()):
         if len(v) != 1:
             raise NotImplementedError("multiple values not managed")