From e694a9ad9b2d405ca39cf5dad9d342d67e012d5e Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Mon, 5 Jan 2015 21:45:42 +0100 Subject: [PATCH] fix OpenSSL usage for py3. Fixes #7915 --- src/gajim.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gajim.py b/src/gajim.py index d9ad833fd..57e61e62e 100644 --- a/src/gajim.py +++ b/src/gajim.py @@ -339,7 +339,10 @@ try: except TypeError: OpenSSL.rand.load_file(RNG_SEED.encode('utf-8')) crypto.add_entropy_sources_OpenSSL() - OpenSSL.rand.write_file(str(RNG_SEED)) + try: + OpenSSL.rand.write_file(RNG_SEED) + except TypeError: + OpenSSL.rand.write_file(RNG_SEED.encode('utf-8')) except ImportError: log.info("PyOpenSSL PRNG not available")