public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
To: git-commits@fedoraproject.org
Subject: [rpms/python-pylibmc] epel10.3: Backport Python 3.13 fix (RHBZ#2295380)
Date: Fri, 25 Sep 2026 17:22:44 GMT [thread overview]
Message-ID: <179035696418.1.18322013704364962665.rpms-python-pylibmc-bd39f94b94f5@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-pylibmc
Branch : epel10.3
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.3
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
reply other threads:[~2026-09-25 17:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179035696418.1.18322013704364962665.rpms-python-pylibmc-bd39f94b94f5@fedoraproject.org \
--to=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox