~mdw
/
catacomb-python
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
catacomb/__init__.py, mp.c: Remove `L' suffix from `repr' output.
[catacomb-python]
/
catacomb
/
pwsafe.py
diff --git
a/catacomb/pwsafe.py
b/catacomb/pwsafe.py
index
d453c8e
..
8fa5ee6
100644
(file)
--- a/
catacomb/pwsafe.py
+++ b/
catacomb/pwsafe.py
@@
-28,6
+28,7
@@
from __future__ import with_statement
from __future__ import with_statement
+import binascii as _B
import errno as _E
import os as _OS
from cStringIO import StringIO as _StringIO
import errno as _E
import os as _OS
from cStringIO import StringIO as _StringIO
@@
-103,10
+104,10
@@
def _dec_metaname(name):
def _b64(s):
"""Encode S as base64, without newlines, and trimming `=' padding."""
def _b64(s):
"""Encode S as base64, without newlines, and trimming `=' padding."""
- return
s.encode('base64'
).replace('\n', '').rstrip('=')
+ return
_text(_B.b2a_base64(s)
).replace('\n', '').rstrip('=')
def _unb64(s):
"""Decode S as base64 with trimmed `=' padding."""
def _unb64(s):
"""Decode S as base64 with trimmed `=' padding."""
- return
(s + '='*((4 - len(s))%4)).decode('base64'
)
+ return
_B.a2b_base64(s + '='*((4 - len(s))%4)
)
def _enc_metaval(val):
"""Encode VAL as a metadata item value, returning the result."""
def _enc_metaval(val):
"""Encode VAL as a metadata item value, returning the result."""