[crypto] Encode unicode strings in _cypherer()
pycrypto accept both bytes or string but pycryptodome, which will be introduced
in next changeset, doesn't accept this.
For backward compatibility, encode unicode strings in _cypherer()
--- a/cubicweb/crypto.py Thu May 16 04:42:59 2019 +0200
+++ b/cubicweb/crypto.py Tue May 21 10:18:38 2019 +0200
@@ -26,6 +26,8 @@
_CYPHERERS = {}
def _cypherer(seed):
+ if isinstance(seed, str):
+ seed = seed.encode('utf-8')
try:
return _CYPHERERS[seed]
except KeyError: