]> git.decadent.org.uk Git - dak.git/blobdiff - daklib/utils.py
Use new package_list view for "dak ls" command.
[dak.git] / daklib / utils.py
index 30683097b57d7b61d666e5115b6f01f50739cd9a..94737d227277df891c618d40cf0672404fbb77ac 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)
 
@@ -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)