]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/utils.py
Use more https://
[dak.git] / daklib / utils.py
index 30683097b57d7b61d666e5115b6f01f50739cd9a..a30107be57632d18b3f604cd8a4094395fd19de8 100644 (file)
@@ -155,11 +155,7 @@ def extract_component_from_section(section, session=None):
 
     # Expand default component
     if component == "":
 
     # Expand default component
     if component == "":
-        comp = get_component(section, session)
-        if comp is None:
-            component = "main"
-        else:
-            component = comp.component_name
+        component = "main"
 
     return (section, component)
 
 
     return (section, component)
 
@@ -570,7 +566,7 @@ def build_file_list(changes, is_a_dsc=0, field="files", hashname="md5sum"):
 
 ################################################################################
 
 
 ################################################################################
 
-# see http://bugs.debian.org/619131
+# see https://bugs.debian.org/619131
 def build_package_list(dsc, session = None):
     if not dsc.has_key("package-list"):
         return {}
 def build_package_list(dsc, session = None):
     if not dsc.has_key("package-list"):
         return {}
@@ -1058,7 +1054,7 @@ def arch_compare_sw (a, b):
 
 ################################################################################
 
 
 ################################################################################
 
-def split_args (s, dwim=1):
+def split_args (s, dwim=True):
     """
     Split command line arguments which can be separated by either commas
     or whitespace.  If dwim is set, it will complain about string ending
     """
     Split command line arguments which can be separated by either commas
     or whitespace.  If dwim is set, it will complain about string ending
@@ -1381,7 +1377,8 @@ def gpg_get_key_addresses(fingerprint):
             except IndexError:
                 continue
             try:
             except IndexError:
                 continue
             try:
-                uid = codecs.decode(uid.decode("utf-8"), "unicode_escape")
+                # Do not use unicode_escape, because it is locale-specific
+                uid = codecs.decode(uid, "string_escape").decode("utf-8")
             except UnicodeDecodeError:
                 uid = uid.decode("latin1") # does not fail
             m = re_parse_maintainer.match(uid)
             except UnicodeDecodeError:
                 uid = uid.decode("latin1") # does not fail
             m = re_parse_maintainer.match(uid)
@@ -1560,7 +1557,7 @@ Cnf = config.Config().Cnf
 
 def parse_wnpp_bug_file(file = "/srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm"):
     """
 
 def parse_wnpp_bug_file(file = "/srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm"):
     """
-    Parses the wnpp bug list available at http://qa.debian.org/data/bts/wnpp_rm
+    Parses the wnpp bug list available at https://qa.debian.org/data/bts/wnpp_rm
     Well, actually it parsed a local copy, but let's document the source
     somewhere ;)
 
     Well, actually it parsed a local copy, but let's document the source
     somewhere ;)