process_control: do not encode to ascii
[~helmut/debian-dedup.git] / dedup / debpkg.py
index dbee849..8f2121b 100644 (file)
@@ -9,15 +9,15 @@ def process_control(control_contents):
     @rtype: {str: object}
     """
     control = deb822.Packages(control_contents)
-    package = control["package"].encode("ascii")
+    package = control["package"]
     try:
-        source = control["source"].encode("ascii").split()[0]
+        source = control["source"].split()[0]
     except KeyError:
         source = package
-    version = control["version"].encode("ascii")
-    architecture = control["architecture"].encode("ascii")
+    version = control["version"]
+    architecture = control["architecture"]
     # deb822 currently returns :any dependencies raw. see #670679
-    depends = set(dep[0]["name"].split(u':', 1)[0].encode("ascii")
+    depends = set(dep[0]["name"].split(u':', 1)[0]
                   for dep in control.relations.get("depends", ())
                   if len(dep) == 1)
     return dict(package=package, source=source, version=version,