Browse Source

Fix more tests

Oz N Tiram 8 years ago
parent
commit
e6ec74778e
2 changed files with 4 additions and 2 deletions
  1. 2 2
      pwman/ui/baseui.py
  2. 2 0
      pwman/util/crypto_engine.py

+ 2 - 2
pwman/ui/baseui.py

@@ -383,7 +383,7 @@ class BaseCommands(HelpUIMixin, AliasesMixin, BaseUtilsMixin):
                                                 node[4],
                                                 node[5:])
                 tags = n.tags
-                tags = ','.join(t.strip() for t in tags)
+                tags = ','.join(t.strip().decode() for t in tags)
                 r = list([n.username, n.url, n.password, n.notes])
                 writer.writerow(r + [tags])
 
@@ -431,7 +431,7 @@ class BaseCommands(HelpUIMixin, AliasesMixin, BaseUtilsMixin):
                 menu.add(CliMenuItem("Url", node.url))
                 menunotes = CliMenuItem("Notes", node.notes)
                 menu.add(menunotes)
-                menu.add(CliMenuItem("Tags", ','.join(node.tags)))
+                menu.add(CliMenuItem("Tags", ','.join(map(lambda x: x.decode(), node.tags))))  # noqa
             menu.run(node)
             self._db.editnode(i, **node.to_encdict())
             # when done with node erase it

+ 2 - 0
pwman/util/crypto_engine.py

@@ -39,6 +39,8 @@ if sys.version_info.major > 2:  # pragma: no cover
 
 
 def encode_AES(cipher, clear_text):
+    if not isinstance(clear_text, bytes):
+        clear_text = clear_text.encode()
     return base64.b64encode(cipher.encrypt(clear_text))