Philipp Hörist pushed to branch master at gajim / python-nbxmpp

Commits:
a1e8cee4 by Philipp Hörist at 2018-04-13T00:30:47+02:00
Fix parsing utf8 cert files

Fixes #51

- - - - -


1 changed file:

- nbxmpp/tls_nb.py


Changes:

=====================================
nbxmpp/tls_nb.py
=====================================
--- a/nbxmpp/tls_nb.py
+++ b/nbxmpp/tls_nb.py
@@ -24,6 +24,7 @@ from .plugin import PlugIn
 import sys
 import os
 import time
+import io
 
 import traceback
 
@@ -337,7 +338,10 @@ class NonBlockingTLS(PlugIn):
         if not os.path.isfile(cert_path):
             return
         try:
-            f = open(cert_path)
+            if sys.version_info[0] > 2:
+                f = open(cert_path, encoding='utf-8')
+            else:
+                f = io.open(cert_path, encoding='utf-8')
         except IOError as e:
             log.warning('Unable to open certificate file %s: %s' % \
                     (cert_path, str(e)))



View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/commit/a1e8cee482709318a2fc4b9486b4ccc59768532c

---
View it on GitLab: 
https://dev.gajim.org/gajim/python-nbxmpp/commit/a1e8cee482709318a2fc4b9486b4ccc59768532c
You're receiving this email because of your account on dev.gajim.org.
_______________________________________________
Commits mailing list
Commits@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/commits

Reply via email to