[projects/pld-builder.new] Update for python 3.13 compatibility.

arekm arekm at pld-linux.org
Mon Mar 17 23:11:05 CET 2025


commit e9101588af484ba20cf2600051ee3d975c23a324
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Mon Mar 17 23:11:02 2025 +0100

    Update for python 3.13 compatibility.

 PLD_Builder/acl.py                    |  2 +-
 PLD_Builder/config.py                 |  2 +-
 PLD_Builder/request_handler_server.py | 11 +++++------
 3 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/PLD_Builder/acl.py b/PLD_Builder/acl.py
index 88ed536..75c3c7b 100644
--- a/PLD_Builder/acl.py
+++ b/PLD_Builder/acl.py
@@ -107,7 +107,7 @@ class ACL_Conf:
         self.current_user = None
         status.push("reading acl.conf")
         p = ConfigParser.ConfigParser()
-        p.readfp(open(path.acl_conf))
+        p.read_file(open(path.acl_conf))
         self.users = {}
         for login in p.sections():
             if login in self.users:
diff --git a/PLD_Builder/config.py b/PLD_Builder/config.py
index 1852f6f..f9cba84 100644
--- a/PLD_Builder/config.py
+++ b/PLD_Builder/config.py
@@ -50,7 +50,7 @@ class Builder_Conf:
             else:
                 log.panic("cannot find %s::%s" % (builder, o))
 
-        p.readfp(open(path.builder_conf))
+        p.read_file(open(path.builder_conf))
 
         self.admin_email = get("admin_email")
         self.email = self.admin_email
diff --git a/PLD_Builder/request_handler_server.py b/PLD_Builder/request_handler_server.py
index 11840ea..be70ae5 100644
--- a/PLD_Builder/request_handler_server.py
+++ b/PLD_Builder/request_handler_server.py
@@ -2,7 +2,6 @@
 
 import socket
 import string
-import cgi
 import time
 import log
 import ssl
@@ -95,11 +94,11 @@ def main(srv_ssl=False):
         try:
             server = HTTPServer((host, port), MyHandler)
             if srv_ssl:
-                server.socket = ssl.wrap_socket (server.socket,
-                                keyfile = config.request_handler_server_ssl_key,
-                                certfile = config.request_handler_server_ssl_cert,
-                                ca_certs = "/etc/certs/ca-certificates.crt",
-                                server_side=True)
+                context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
+                context.load_cert_chain(certfile=config.request_handler_server_ssl_cert,
+                                        keyfile=config.request_handler_server_ssl_key)
+                context.load_verify_locations(cafile="/etc/certs/ca-certificates.crt")
+                server.socket = context.wrap_socket(server.socket, server_side=True)
         except Exception as e:
             log.notice("request_handler_server: can't start server on [%s:%d], ssl=%s: %s" % (host, port, str(srv_ssl), e))
             print >> sys.stderr, "ERROR: Can't start server on [%s:%d], ssl=%s: %s" % (host, port, str(srv_ssl), e)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/projects/pld-builder.new.git/commitdiff/e9101588af484ba20cf2600051ee3d975c23a324



More information about the pld-cvs-commit mailing list