Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-websockets for 
openSUSE:Factory checked in at 2023-09-22 21:47:16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-websockets (Old)
 and      /work/SRC/openSUSE:Factory/.python-websockets.new.1770 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-websockets"

Fri Sep 22 21:47:16 2023 rev:24 rq:1112605 version:11.0.3

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-websockets/python-websockets.changes      
2023-09-07 21:14:01.048043131 +0200
+++ 
/work/SRC/openSUSE:Factory/.python-websockets.new.1770/python-websockets.changes
    2023-09-22 21:48:23.174977825 +0200
@@ -1,0 +2,5 @@
+Wed Sep 20 14:58:11 UTC 2023 - Markéta Machová <[email protected]>
+
+- Add py312-shutdown.patch to fix server shutdown on Python 3.12
+
+-------------------------------------------------------------------

New:
----
  py312-shutdown.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-websockets.spec ++++++
--- /var/tmp/diff_new_pack.SqB1xQ/_old  2023-09-22 21:48:24.183014419 +0200
+++ /var/tmp/diff_new_pack.SqB1xQ/_new  2023-09-22 21:48:24.187014565 +0200
@@ -25,6 +25,8 @@
 Group:          Development/Languages/Python
 URL:            https://github.com/aaugustin/websockets
 Source:         
https://github.com/aaugustin/websockets/archive/%{version}.tar.gz
+# PATCH-FIX-UPSTREAM 
https://github.com/python-websockets/websockets/commit/03d62c97fcafffa5cdbe4bb55b2a8d17a62eca33
 Fix server shutdown on Python 3.12.
+Patch:          py312-shutdown.patch
 BuildRequires:  %{python_module devel >= 3.7}
 BuildRequires:  %{python_module pytest}
 BuildRequires:  %{python_module setuptools}

++++++ py312-shutdown.patch ++++++
>From 03d62c97fcafffa5cdbe4bb55b2a8d17a62eca33 Mon Sep 17 00:00:00 2001
From: Aymeric Augustin <[email protected]>
Date: Thu, 18 May 2023 16:52:39 +0200
Subject: [PATCH] Fix server shutdown on Python 3.12.

Ref https://github.com/python/cpython/issues/79033.

Fix #1356.
---
 src/websockets/legacy/server.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Index: websockets-11.0.3/src/websockets/legacy/server.py
===================================================================
--- websockets-11.0.3.orig/src/websockets/legacy/server.py
+++ websockets-11.0.3/src/websockets/legacy/server.py
@@ -765,18 +765,13 @@ class WebSocketServer:
         # Stop accepting new connections.
         self.server.close()
 
-        # Wait until self.server.close() completes.
-        await self.server.wait_closed()
-
         # Wait until all accepted connections reach connection_made() and call
         # register(). See https://bugs.python.org/issue34852 for details.
         await asyncio.sleep(0, **loop_if_py_lt_38(self.get_loop()))
 
         if close_connections:
-            # Close OPEN connections with status code 1001. Since the server 
was
-            # closed, handshake() closes OPENING connections with an HTTP 503
-            # error. Wait until all connections are closed.
-
+            # Close OPEN connections with close code 1001. After 
server.close(),
+            # handshake() closes OPENING connections with an HTTP 503 error.
             close_tasks = [
                 asyncio.create_task(websocket.close(1001))
                 for websocket in self.websockets
@@ -789,8 +784,10 @@ class WebSocketServer:
                     **loop_if_py_lt_38(self.get_loop()),
                 )
 
-        # Wait until all connection handlers are complete.
+        # Wait until all TCP connections are closed.
+        await self.server.wait_closed()
 
+        # Wait until all connection handlers terminate.
         # asyncio.wait doesn't accept an empty first argument.
         if self.websockets:
             await asyncio.wait(

Reply via email to