-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update python-thriftpy2 to version 0.5.2 / rev 11 via SR 1248709
https://build.opensuse.org/request/show/1248709 by user dgarcia + dimstar_suse - Add patch 0001-Use-SO_REUSEPORT-only-for-AF_INET-sockets.patch to make it compatible with latest cpython. gh#Thriftpy/thriftpy2#303 - Update to 0.5.2: * Fix an issue where loading a thrift file in a sub-thread will cause an error with load_fp. * Move static metadata from setup.py to pyproject.toml. * Using a thread pool to avoid TAsyncSocket.open block the event loop. - 0.5.1: * Fix an issue where loading a thrift file in a sub-thread will cause an error. * Some typo fixes.
- Loading branch information
1 parent
68af4c4
commit 9196a8c
Showing
7 changed files
with
87 additions
and
6 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
packages/p/python-thriftpy2/0001-Use-SO_REUSEPORT-only-for-AF_INET-sockets.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
From 6590305637da64e0b1898bbb2ecd9700aef7c06b Mon Sep 17 00:00:00 2001 | ||
From: Daniel Garcia Moreno <[email protected]> | ||
Date: Wed, 26 Feb 2025 13:00:45 +0100 | ||
Subject: [PATCH] Use SO_REUSEPORT only for AF_INET sockets | ||
|
||
The latest python version changes the behavior, now if it's used with | ||
other kind of sockets (ex AF_UNIX) it raises OSError: | ||
|
||
https://github.com/python/cpython/issues/128916 | ||
--- | ||
thriftpy2/contrib/aio/socket.py | 4 +++- | ||
thriftpy2/transport/socket.py | 4 +++- | ||
2 files changed, 6 insertions(+), 2 deletions(-) | ||
|
||
diff --git a/thriftpy2/contrib/aio/socket.py b/thriftpy2/contrib/aio/socket.py | ||
index 8f4195a..28b0cc8 100644 | ||
--- a/thriftpy2/contrib/aio/socket.py | ||
+++ b/thriftpy2/contrib/aio/socket.py | ||
@@ -281,7 +281,9 @@ class TAsyncServerSocket(object): | ||
_sock = socket.socket(self.socket_family, socket.SOCK_STREAM) | ||
|
||
_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
- if hasattr(socket, "SO_REUSEPORT"): | ||
+ # valid socket https://github.com/python/cpython/issues/128916 | ||
+ valid_family = (socket.AF_INET, socket.AF_INET6) | ||
+ if _sock.family in valid_family and hasattr(socket, "SO_REUSEPORT"): | ||
try: | ||
_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) | ||
except socket.error as err: | ||
diff --git a/thriftpy2/transport/socket.py b/thriftpy2/transport/socket.py | ||
index edd78ab..b98b4c8 100644 | ||
--- a/thriftpy2/transport/socket.py | ||
+++ b/thriftpy2/transport/socket.py | ||
@@ -201,7 +201,9 @@ class TServerSocket(object): | ||
_sock = socket.socket(self.socket_family, socket.SOCK_STREAM) | ||
|
||
_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | ||
- if hasattr(socket, "SO_REUSEPORT"): | ||
+ # valid socket https://github.com/python/cpython/issues/128916 | ||
+ valid_family = (socket.AF_INET, socket.AF_INET6) | ||
+ if _sock.family in valid_family and hasattr(socket, "SO_REUSEPORT"): | ||
try: | ||
_sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1) | ||
except socket.error as err: | ||
-- | ||
2.48.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
------------------------------------------------------------------- | ||
Wed Feb 26 11:05:48 UTC 2025 - Daniel Garcia <[email protected]> | ||
|
||
- Add patch 0001-Use-SO_REUSEPORT-only-for-AF_INET-sockets.patch to | ||
make it compatible with latest cpython. gh#Thriftpy/thriftpy2#303 | ||
- Update to 0.5.2: | ||
* Fix an issue where loading a thrift file in a sub-thread will cause an error with load_fp. | ||
* Move static metadata from setup.py to pyproject.toml. | ||
* Using a thread pool to avoid TAsyncSocket.open block the event loop. | ||
- 0.5.1: | ||
* Fix an issue where loading a thrift file in a sub-thread will cause an error. | ||
* Some typo fixes. | ||
|
||
------------------------------------------------------------------- | ||
Wed May 29 11:59:34 UTC 2024 - John Paul Adrian Glaubitz <[email protected]> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/ipfs/bafkreihekquyrdamth73fol26irvvt66a53kecdlhwvxx3wqjmlacvz4ym |