public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-astroid] rawhide: Fix FTBFS
@ 2026-08-04 21:04 Gwyn Ciesla
0 siblings, 0 replies; only message in thread
From: Gwyn Ciesla @ 2026-08-04 21:04 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-astroid
Branch : rawhide
Commit : 583c3c9a09747d11c26fa4c20f8ae50ecfc09a31
Author : Gwyn Ciesla <gwync@protonmail.com>
Date : 2026-08-04T16:04:24-05:00
Stats : +97/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-astroid/c/583c3c9a09747d11c26fa4c20f8ae50ecfc09a31?branch=rawhide
Log:
Fix FTBFS
---
diff --git a/3161.patch b/3161.patch
new file mode 100644
index 0000000..40a00e7
--- /dev/null
+++ b/3161.patch
@@ -0,0 +1,95 @@
+From b2f271184e8e3ba66ec24801c85dc82e5df788e1 Mon Sep 17 00:00:00 2001
+From: Filipe Rosset <rosset.filipe@gmail.com>
+Date: Mon, 27 Jul 2026 22:35:50 -0300
+Subject: [PATCH 1/2] In Python 3.15 with OpenSSL 4.0, legacy TLS/SSL protocols
+ (like PROTOCOL_TLSv1, PROTOCOL_SSLv23, etc.) are completely removed.
+
+Let's dynamically inspect the host's ssl capabilities. If the
+legacy protocol constants are missing at runtime, it falls back
+to registering static dummy values. This allows code referencing
+the old constants to still be parsed correctly and pass the tests.
+
+Signed-off-by: Filipe Rosset <rosset.filipe@gmail.com>
+---
+ astroid/brain/brain_ssl.py | 20 +++++++++++++++++++-
+ 1 file changed, 19 insertions(+), 1 deletion(-)
+
+diff --git a/astroid/brain/brain_ssl.py b/astroid/brain/brain_ssl.py
+index 4cb89f809b..742a1d5b94 100644
+--- a/astroid/brain/brain_ssl.py
++++ b/astroid/brain/brain_ssl.py
+@@ -49,6 +49,23 @@ class Options(_IntFlag):
+
+
+ def ssl_transform() -> nodes.Module:
++ # In Python 3.15 with OpenSSL 4.0, legacy TLS/SSL protocols (like
++ # PROTOCOL_TLSv1, PROTOCOL_SSLv23, etc.) are completely removed.
++ # Let's dynamically inspect the host's ssl capabilities. If the
++ # legacy protocol constants are missing at runtime, it falls back
++ # to registering static dummy values. This allows code referencing
++ # the old constants to still be parsed correctly and pass test suites.
++ import ssl
++ legacy_imports = []
++ legacy_fallback = []
++ for name, val in [("PROTOCOL_SSLv23", 2), ("PROTOCOL_TLSv1", 3), ("PROTOCOL_TLSv1_1", 4), ("PROTOCOL_TLSv1_2", 5)]:
++ if hasattr(ssl, name):
++ legacy_imports.append(name)
++ else:
++ legacy_fallback.append(f"{name} = {val}")
++ imports_str = f"from _ssl import {', '.join(legacy_imports)}" if legacy_imports else ""
++ fallback_str = "\n ".join(legacy_fallback)
++
+ return parse(f"""
+ # Import necessary for conversion of objects defined in C into enums
+ from enum import IntEnum as _IntEnum, IntFlag as _IntFlag
+@@ -105,7 +122,8 @@ def ssl_transform() -> nodes.Module:
+ from _ssl import VERIFY_CRL_CHECK_CHAIN, VERIFY_CRL_CHECK_LEAF, VERIFY_DEFAULT, VERIFY_X509_STRICT
+ from _ssl import HAS_SNI, HAS_ECDH, HAS_NPN, HAS_ALPN
+ from _ssl import _OPENSSL_API_VERSION
+- from _ssl import PROTOCOL_SSLv23, PROTOCOL_TLSv1, PROTOCOL_TLSv1_1, PROTOCOL_TLSv1_2
++ {imports_str}
++ {fallback_str}
+ from _ssl import PROTOCOL_TLS, PROTOCOL_TLS_CLIENT, PROTOCOL_TLS_SERVER
+
+ class AlertDescription(_IntEnum):
+
+From f10675691149879ce388db2aa47cf89a35ad5b62 Mon Sep 17 00:00:00 2001
+From: "pre-commit-ci[bot]"
+ <66853113+pre-commit-ci[bot]@users.noreply.github.com>
+Date: Tue, 28 Jul 2026 01:40:41 +0000
+Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks
+
+for more information, see https://pre-commit.ci
+---
+ astroid/brain/brain_ssl.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/astroid/brain/brain_ssl.py b/astroid/brain/brain_ssl.py
+index 742a1d5b94..5803d26197 100644
+--- a/astroid/brain/brain_ssl.py
++++ b/astroid/brain/brain_ssl.py
+@@ -56,14 +56,22 @@ def ssl_transform() -> nodes.Module:
+ # to registering static dummy values. This allows code referencing
+ # the old constants to still be parsed correctly and pass test suites.
+ import ssl
++
+ legacy_imports = []
+ legacy_fallback = []
+- for name, val in [("PROTOCOL_SSLv23", 2), ("PROTOCOL_TLSv1", 3), ("PROTOCOL_TLSv1_1", 4), ("PROTOCOL_TLSv1_2", 5)]:
++ for name, val in [
++ ("PROTOCOL_SSLv23", 2),
++ ("PROTOCOL_TLSv1", 3),
++ ("PROTOCOL_TLSv1_1", 4),
++ ("PROTOCOL_TLSv1_2", 5),
++ ]:
+ if hasattr(ssl, name):
+ legacy_imports.append(name)
+ else:
+ legacy_fallback.append(f"{name} = {val}")
+- imports_str = f"from _ssl import {', '.join(legacy_imports)}" if legacy_imports else ""
++ imports_str = (
++ f"from _ssl import {', '.join(legacy_imports)}" if legacy_imports else ""
++ )
+ fallback_str = "\n ".join(legacy_fallback)
+
+ return parse(f"""
diff --git a/python-astroid.spec b/python-astroid.spec
index 087be94..1a38d8e 100644
--- a/python-astroid.spec
+++ b/python-astroid.spec
@@ -18,7 +18,8 @@ Patch: https://github.com/pylint-dev/astroid/pull/3047.patch
# Fix is_namespace() crash with namespace packages on Python 3.15
# https://github.com/pylint-dev/astroid/pull/3035
Patch: fix-py315-is-namespace.patch
-
+# Fix test_ssl with openssl 4
+Patch: 3161.patch
BuildArch: noarch
BuildRequires: python3-devel
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-04 21:04 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-04 21:04 [rpms/python-astroid] rawhide: Fix FTBFS Gwyn Ciesla
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox