Utilities/__init__.py

changeset 37
bfe92e414977
parent 28
dde24fc7f7ba
child 41
572a009369f0
--- a/Utilities/__init__.py	Thu Jan 07 15:22:29 2010 +0000
+++ b/Utilities/__init__.py	Thu Jan 07 19:03:58 2010 +0000
@@ -1164,7 +1164,7 @@
     pop = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.,;:-_!$?*+#"
     marker = "CE4"
     rpw = "".join(random.sample(pop, 32)) + pw + "".join(random.sample(pop, 32))
-    return marker + base64.b64encode(rpw)
+    return marker + base64.b64encode(rpw.encode()).decode()
 
 def pwDecode(epw):
     """
@@ -1176,7 +1176,7 @@
     if not epw.startswith("CE4"):
         return epw  # it was not encoded using pwEncode
     
-    return base64.b64decode(epw[3:])[32:-32]
+    return base64.b64decode(epw[3:].encode())[32:-32].decode()
 
 ################################################################################
 # posix compatibility functions below

eric ide

mercurial