fix random python 3 porting consequences.
authorEdouard Tisserant <edouard@beremiz.fr>
Wed, 26 Feb 2025 16:33:13 +0100 (2 weeks ago)
changeset 4118 f9f116d8a022
parent 4117 49e297aaf694
child 4119 766f3e0e7277
fix random python 3 porting consequences.
runtime/Stunnel.py
runtime/WampClient.py
--- a/runtime/Stunnel.py	Wed Feb 26 16:31:59 2025 +0100
+++ b/runtime/Stunnel.py	Wed Feb 26 16:33:13 2025 +0100
@@ -30,7 +30,7 @@
     secret = os.urandom(192)  # int(256/1.3333)
     secretstring = b2a_base64(secret)
 
-    PSKstring = ID+":"+secretstring
+    PSKstring = ID+":"+secretstring.decode()
     with open(PSKpath, 'w') as f:
         f.write(PSKstring)
     restartStunnel()
--- a/runtime/WampClient.py	Wed Feb 26 16:31:59 2025 +0100
+++ b/runtime/WampClient.py	Wed Feb 26 16:33:13 2025 +0100
@@ -362,7 +362,7 @@
     if os.path.exists(_WampTrust):
         cert = crypto.load_certificate(
             crypto.FILETYPE_PEM,
-            six.u(open(_WampTrust, 'r').read())
+            open(_WampTrust, 'rb').read()
         )
         trustRoot=OpenSSLCertificateAuthorities([cert])
     return optionsForClientTLS(_transportFactory.host, trustRoot=trustRoot)