changeset 00cf0293b7a3 in /home/hg/repos/gajim
author: Yann Leboulanger asterix@lagaule.org branches: gtk3 details:http://hg.gajim.org/gajim?cmd=changeset;node=00cf0293b7a3 description: py2 -> py3
diffstat:
src/common/connection.py | 8 ++++---- src/common/connection_handlers_events.py | 4 ++-- src/common/jingle_xtls.py | 3 ++- src/gajim.py | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-)
diffs (74 lines):
diff -r 55eca1db3e67 -r 00cf0293b7a3 src/common/connection.py --- a/src/common/connection.py Fri Dec 27 12:42:19 2013 +0100 +++ b/src/common/connection.py Mon Dec 30 20:56:09 2013 +0100 @@ -1395,15 +1395,15 @@ text += _('\nSSL Error: <b>%s</b>') % ssl_error[errnum] else: text += _('\nUnknown SSL error: %d') % errnum - fingerprint = cert.digest('sha1') + fingerprint = cert.digest('sha1').decode('utf-8') pem = OpenSSL.crypto.dump_certificate(OpenSSL.crypto.FILETYPE_PEM, - cert) + cert).decode('utf-8') gajim.nec.push_incoming_event(SSLErrorEvent(None, conn=self, error_text=text, error_num=errnum, cert=pem, fingerprint=fingerprint, certificate=cert)) return True if cert: - fingerprint = cert.digest('sha1') + fingerprint = cert.digest('sha1').decode('utf-8') saved_fingerprint = gajim.config.get_per('accounts', self.name, 'ssl_fingerprint_sha1') if saved_fingerprint: @@ -1420,7 +1420,7 @@ '100' not in gajim.config.get_per('accounts', self.name, 'ignore_ssl_errors').split(): pem = OpenSSL.crypto.dump_certificate( - OpenSSL.crypto.FILETYPE_PEM, cert) + OpenSSL.crypto.FILETYPE_PEM, cert).decode('utf-8') txt = _('The authenticity of the %s certificate could be ' 'invalid.\nThe certificate does not cover this domain.') %\ hostname diff -r 55eca1db3e67 -r 00cf0293b7a3 src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Fri Dec 27 12:42:19 2013 +0100 +++ b/src/common/connection_handlers_events.py Mon Dec 30 20:56:09 2013 +0100 @@ -1639,8 +1639,8 @@ if self.conn.connection.Connection.ssl_certificate: cert = self.conn.connection.Connection.ssl_certificate self.ssl_cert = OpenSSL.crypto.dump_certificate( - OpenSSL.crypto.FILETYPE_PEM, cert) - self.ssl_fingerprint = cert.digest('sha1') + OpenSSL.crypto.FILETYPE_PEM, cert).decode('utf-8') + self.ssl_fingerprint = cert.digest('sha1').decode('utf-8') return True
class NewAccountNotConnectedEvent(nec.NetworkIncomingEvent): diff -r 55eca1db3e67 -r 00cf0293b7a3 src/common/jingle_xtls.py --- a/src/common/jingle_xtls.py Fri Dec 27 12:42:19 2013 +0100 +++ b/src/common/jingle_xtls.py Mon Dec 30 20:56:09 2013 +0100 @@ -289,7 +289,8 @@ os.chmod(filepath + '.pkey', 0600) f.write(crypto.dump_privatekey(crypto.FILETYPE_PEM, key)) with open(filepath + '.cert', 'wb') as f: - f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert)) + f.write(crypto.dump_certificate(crypto.FILETYPE_PEM, cert).decode( + 'utf-8'))
if __name__ == '__main__': diff -r 55eca1db3e67 -r 00cf0293b7a3 src/gajim.py --- a/src/gajim.py Fri Dec 27 12:42:19 2013 +0100 +++ b/src/gajim.py Mon Dec 30 20:56:09 2013 +0100 @@ -71,10 +71,10 @@ try: from distutils.version import LooseVersion as V if V(nbxmpp.__version__) < V("0.3"): - print 'Gajim needs python-nbxmpp > 0.3 to run. Quiting...' + print('Gajim needs python-nbxmpp > 0.3 to run. Quiting...') sys.exit() except: - print 'Gajim needs python-nbxmpp > 0.3 to run. Quiting...' + print('Gajim needs python-nbxmpp > 0.3 to run. Quiting...') sys.exit()
#from common import demandimport