Pyopenssl uses broken string detection in Python 3 workaround
Bug description
When logging into an account using TLS, pyopenssl raises a TypeError because it uses string detection that is broken on Python 3.
Steps to reproduce
Use Python 3, install pyopenssl, try to launch Gajim using the latest default branch code as of this issue being filed (changeset: 15628:81a8581bfed4). There are workarounds for this throughout the code, but it is missing in one place.
Easy fix:
diff -r 96ab9c5e925b src/gajim.py
--- a/src/gajim.py Fri Jan 02 21:53:59 2015 +0100
+++ b/src/gajim.py Mon Jan 05 14:10:20 2015 -0500
@@ -339,7 +339,10 @@
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.load_file(RNG_SEED)
+ except TypeError:
+ OpenSSL.rand.write_file(RNG_SEED.encode('utf-8'))
except ImportError:
log.info("PyOpenSSL PRNG not available")