public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-yarl] f44: Fix compatibility with Python 3.15
@ 2026-09-23 10:55 Karolina Surma
  0 siblings, 0 replies; only message in thread
From: Karolina Surma @ 2026-09-23 10:55 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/python-yarl
Branch : f44
Commit : f7de81d58d0e1b4353a4630355aa74238d24946d
Author : Karolina Surma <ksurma@redhat.com>
Date   : 2026-04-10T09:31:51+02:00
Stats  : +35/-0 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/python-yarl/c/f7de81d58d0e1b4353a4630355aa74238d24946d?branch=f44

Log:
Fix compatibility with Python 3.15

---
diff --git a/Fix-pickling-with-Python-3.15.patch b/Fix-pickling-with-Python-3.15.patch
new file mode 100644
index 0000000..3322966
--- /dev/null
+++ b/Fix-pickling-with-Python-3.15.patch
@@ -0,0 +1,32 @@
+From 4dc81a3d1fcb801e0e75bd18dff756964c6c3e71 Mon Sep 17 00:00:00 2001
+From: Karolina Surma <ksurma@redhat.com>
+Date: Tue, 10 Mar 2026 14:39:28 +0100
+Subject: [PATCH 1/2] Fix pickling URLs with Python 3.15.0a6+ (Fixes #1632)
+
+In Python 3.15 urllib.parse.SplitResult gained a new __getstate__
+method which fails when called on instances created via tuple.__new__:
+https://github.com/python/cpython/commit/c5cfcdf1
+Returning self._val directly instead of creating a new SplitResult
+instance avoids the problematic code path, and is backwards compatible.
+---
+ yarl/_url.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/yarl/_url.py b/yarl/_url.py
+index 527a576..90f3dce 100644
+--- a/yarl/_url.py
++++ b/yarl/_url.py
+@@ -556,8 +556,8 @@ class URL:
+     def __bool__(self) -> bool:
+         return bool(self._netloc or self._path or self._query or self._fragment)
+ 
+-    def __getstate__(self) -> tuple[SplitResult]:
+-        return (tuple.__new__(SplitResult, self._val),)
++    def __getstate__(self) -> tuple[SplitURLType]:
++        return (self._val,)
+ 
+     def __setstate__(
+         self, state: Union[tuple[SplitURLType], tuple[None, _InternalURLCache]]
+-- 
+2.53.0
+

diff --git a/python-yarl.spec b/python-yarl.spec
index d384d60..f8590d5 100644
--- a/python-yarl.spec
+++ b/python-yarl.spec
@@ -9,6 +9,9 @@ Summary:        Python module to handle URLs
 License:        Apache-2.0
 URL:            https://yarl.readthedocs.io
 Source0:        https://github.com/aio-libs/yarl/archive/v%{version}/%{pypi_name}-%{version}.tar.gz
+# Compatibility with Python 3.15
+# Adapted from: https://github.com/aio-libs/yarl/pull/1642
+Patch:          Fix-pickling-with-Python-3.15.patch
 
 BuildRequires:  gcc
 BuildRequires:  python3-devel

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-23 10:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-23 10:55 [rpms/python-yarl] f44: Fix compatibility with Python 3.15 Karolina Surma

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox