# HG changeset patch # User Philippe Pepiot # Date 1558426718 -7200 # Node ID 48a010b35af2154717adaa9dc811cd410dbf76ed # Parent 8ac9ac8d91433d6c915760fb55ce443929b64641 [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() diff -r 8ac9ac8d9143 -r 48a010b35af2 cubicweb/crypto.py --- 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: