public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-pylibmc] epel10: Backport Python 3.13 fix (RHBZ#2295380)
@ 2026-09-25 17:05
0 siblings, 0 replies; only message in thread
From: @ 2026-09-25 17:05 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-pylibmc
Branch : epel10
Commit : bd39f94b94f5dcb0df9cdd6f858e9dcc2a74769a
Author : František Zatloukal <fzatlouk@redhat.com>
Date : 2024-07-03T13:55:27+02:00
Stats : +60/-1 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-pylibmc/c/bd39f94b94f5dcb0df9cdd6f858e9dcc2a74769a?branch=epel10
Log:
Backport Python 3.13 fix (RHBZ#2295380)
---
diff --git a/292.patch b/292.patch
new file mode 100644
index 0000000..634d622
--- /dev/null
+++ b/292.patch
@@ -0,0 +1,55 @@
+From d18ad2911676b4d6b03877ffe94178ea983dc387 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Wed, 3 Jul 2024 12:58:59 +0200
+Subject: [PATCH] Stop accessing None as a dictionary
+
+PyMapping_HasKeyString does not work on None
+Accidentally, it used to return false result on silent errors.
+
+Since Python 3.13, this is what happens instead:
+
+ >>> import pylibmc
+ >>> m = pylibmc.Client(["10.0.0.1"], binary=True)
+ Exception ignored in PyMapping_HasKeyString(); consider using PyMapping_HasKeyStringWithError(), PyMapping_GetOptionalItemString() or PyMapping_GetItemString():
+ Traceback (most recent call last):
+ File "/usr/lib64/python3.13/site-packages/pylibmc/client.py", line 142, in __init__
+ super().__init__(servers=translate_server_specs(servers),
+ TypeError: 'NoneType' object is not subscriptable
+ ...
+ Exception ignored in PyMapping_HasKeyString(); consider using PyMapping_HasKeyStringWithError(), PyMapping_GetOptionalItemString() or PyMapping_GetItemString():
+ Traceback (most recent call last):
+ File "/usr/lib64/python3.13/site-packages/pylibmc/client.py", line 142, in __init__
+ super().__init__(servers=translate_server_specs(servers),
+ TypeError: 'NoneType' object is not subscriptable
+
+When this is run via pytest, it leads to:
+
+ pytest.PytestUnraisableExceptionWarning: Exception ignored in PyMapping_HasKeyString(); consider using PyMapping_HasKeyStringWithError(), PyMapping_GetOptionalItemString() or PyMapping_GetItemString(): None
+
+Fixes https://github.com/pallets-eco/cachelib/issues/400
+---
+ src/_pylibmcmodule.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/_pylibmcmodule.c b/src/_pylibmcmodule.c
+index a34d2b5..545b658 100644
+--- a/src/_pylibmcmodule.c
++++ b/src/_pylibmcmodule.c
+@@ -2082,7 +2082,7 @@ static PyObject *PylibMC_Client_set_behaviors(PylibMC_Client *self,
+ char *key;
+
+ for (b = PylibMC_behaviors; b->name != NULL; b++) {
+- if (!PyMapping_HasKeyString(behaviors, b->name)) {
++ if (behaviors == Py_None || !PyMapping_HasKeyString(behaviors, b->name)) {
+ continue;
+ } else if ((py_v = PyMapping_GetItemString(behaviors, b->name)) == NULL) {
+ goto error;
+@@ -2112,7 +2112,7 @@ static PyObject *PylibMC_Client_set_behaviors(PylibMC_Client *self,
+ }
+
+ for (b = PylibMC_callbacks; b->name != NULL; b++) {
+- if (!PyMapping_HasKeyString(behaviors, b->name)) {
++ if (behaviors == Py_None || !PyMapping_HasKeyString(behaviors, b->name)) {
+ continue;
+ } else if ((py_v = PyMapping_GetItemString(behaviors, b->name)) == NULL) {
+ goto error;
diff --git a/python-pylibmc.spec b/python-pylibmc.spec
index a87c53a..3f1c132 100644
--- a/python-pylibmc.spec
+++ b/python-pylibmc.spec
@@ -10,6 +10,10 @@ License: BSD
URL: http://sendapatch.se/projects/pylibmc/
Source0: https://pypi.python.org/packages/source/p/%{srcname}/%{srcname}-%{version}.tar.gz
+# https://github.com/lericson/pylibmc/pull/292
+# Python 3.13 compat
+Patch01: 292.patch
+
BuildRequires: gcc
BuildRequires: python3-devel
BuildRequires: python3-setuptools
@@ -35,7 +39,7 @@ so that applications can drop-in replace it.
%prep
-%setup -q -n %{srcname}-%{version}
+%autosetup -n %{srcname}-%{version} -p1
%build
%py3_build
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-09-25 17:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25 17:05 [rpms/python-pylibmc] epel10: Backport Python 3.13 fix (RHBZ#2295380)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox