Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package python-psutil for openSUSE:Factory 
checked in at 2026-11-16 09:07:30
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-psutil (Old)
 and      /work/SRC/openSUSE:Factory/.python-psutil.new.1251 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-psutil"

Mon Nov 16 09:07:30 2026 rev:94 rq:1397214 version:7.2.2

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-psutil/python-psutil.changes      
2026-11-06 19:37:12.094010604 +0100
+++ /work/SRC/openSUSE:Factory/.python-psutil.new.1251/python-psutil.changes    
2026-11-16 09:11:21.004042480 +0100
@@ -1,0 +2,6 @@
+Fri Nov 13 04:18:47 UTC 2026 - Steve Kowalik <[email protected]>
+
+- Replace rlim_infinity.patch with a different patch to actually fix
+  compatibility with Python 3.15.
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-psutil.spec ++++++
--- /var/tmp/diff_new_pack.JHX91R/_old  2026-11-16 09:11:21.653069690 +0100
+++ /var/tmp/diff_new_pack.JHX91R/_new  2026-11-16 09:11:21.655069774 +0100
@@ -36,7 +36,7 @@
 License:        BSD-3-Clause
 URL:            https://github.com/giampaolo/psutil
 Source:         
https://files.pythonhosted.org/packages/source/p/psutil/psutil-%{version}.tar.gz
-# PATCH-FIX-UPSTREAM https://github.com/giampaolo/psutil/pull/2871 Handle 
RLIM_INFINITY on Python 3.15 on linux
+# PATCH-FIX-UPSTREAM Based on gh#giampaolo/psutil#3110
 Patch:          rlim_infinity.patch
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module pip}

++++++ rlim_infinity.patch ++++++
--- /var/tmp/diff_new_pack.JHX91R/_old  2026-11-16 09:11:21.695071451 +0100
+++ /var/tmp/diff_new_pack.JHX91R/_new  2026-11-16 09:11:21.699071618 +0100
@@ -1,72 +1,107 @@
-From b408cfc0a05266a0509ccbb13e253f2d2000ed9f Mon Sep 17 00:00:00 2001
+From 4c78c02a00ea3a30c7ab237e80dfe36e4c0c175e Mon Sep 17 00:00:00 2001
 From: Giampaolo Rodola <[email protected]>
-Date: Fri, 17 Jul 2026 19:46:19 +0200
-Subject: [PATCH] Handle RLIM_INFINITY on Python 3.15 on linux (#2871)
+Date: Sun, 8 Nov 2026 23:10:35 +0100
+Subject: [PATCH] Make RLIM_INFINITY match resource.RLIM_INFINITY
 
-`Process.rlimit` returns `RLIM_INFINITY` as unsigned `2**64-1` instead
-of `-1` on Python 3.15+, which changed `resource.prlimit()` accordingly.
-psutil now maps it back to `psutil.RLIM_INFINITY` so the value stays
-consistent across Python versions.
 ---
- docs/changelog.rst  |  5 +++++
- psutil/_pslinux.py  | 13 ++++++++++++-
- tests/test_linux.py | 14 ++++++++++++++
- 3 files changed, 31 insertions(+), 1 deletion(-)
+ psutil/__init__.py       |  8 ++++++--
+ psutil/arch/posix/init.c | 15 ---------------
+ tests/test_process.py    | 11 ++++++++++-
+ 3 files changed, 16 insertions(+), 18 deletions(-)
 
-Index: psutil-7.2.2/psutil/_pslinux.py
+Index: psutil-7.2.2/psutil/__init__.py
 ===================================================================
---- psutil-7.2.2.orig/psutil/_pslinux.py
-+++ psutil-7.2.2/psutil/_pslinux.py
-@@ -77,6 +77,10 @@ PAGESIZE = cext.getpagesize()
- LITTLE_ENDIAN = sys.byteorder == 'little'
- UNSET = object()
- 
-+# Python 3.15 changed resource.prlimit() to return RLIM_INFINITY as the
-+# unsigned 2**64-1 instead of -1; used to map it back to -1.
-+RLIM_INFINITY_UNSIGNED = cext.RLIM_INFINITY & 0xFFFFFFFFFFFFFFFF
+--- psutil-7.2.2.orig/psutil/__init__.py
++++ psutil-7.2.2/psutil/__init__.py
+@@ -191,14 +191,18 @@ __all__.extend(_psplatform.__extra__all_
+ 
+ # Linux, FreeBSD
+ if hasattr(_psplatform.Process, "rlimit"):
+-    # Populate global namespace with RLIM* constants.
++    import resource
 +
- # "man iostat" states that sectors are equivalent with blocks and have
- # a size of 512 bytes. Despite this value can be queried at runtime
- # via /sys/block/{DISK}/queue/hw_sector_size and results may vary
-@@ -2170,7 +2174,14 @@ class Process:
-             try:
-                 if limits is None:
-                     # get
--                    return resource.prlimit(self.pid, resource_)
-+                    soft, hard = resource.prlimit(self.pid, resource_)
-+                    # Python 3.15 returns RLIM_INFINITY as the unsigned
-+                    # 2**64-1 instead of -1; map it back for consistency.
-+                    if soft == RLIM_INFINITY_UNSIGNED:
-+                        soft = cext.RLIM_INFINITY
-+                    if hard == RLIM_INFINITY_UNSIGNED:
-+                        hard = cext.RLIM_INFINITY
-+                    return soft, hard
-                 else:
-                     # set
-                     if len(limits) != 2:
-Index: psutil-7.2.2/tests/test_linux.py
++    # Populate global namespace with RLIMIT_* constants.
+     _globals = globals()
+     _name = None
+     for _name in dir(_psplatform.cext):
+-        if _name.startswith('RLIM') and _name.isupper():
++        if _name.startswith('RLIMIT_') and _name.isupper():
+             _globals[_name] = getattr(_psplatform.cext, _name)
+             __all__.append(_name)
+     del _globals, _name
++    RLIM_INFINITY = resource.RLIM_INFINITY
++    __all__.append("RLIM_INFINITY")
+ 
+ AF_LINK = _psplatform.AF_LINK
+ 
+Index: psutil-7.2.2/psutil/arch/posix/init.c
 ===================================================================
---- psutil-7.2.2.orig/tests/test_linux.py
-+++ psutil-7.2.2/tests/test_linux.py
-@@ -2280,6 +2280,20 @@ class TestProcessAgainstStatus(PsutilTes
- # --- test utils
- # =====================================================================
- 
-+    def test_rlimit_infinity_normalized(self):
-+        # Python 3.15 changed resource.prlimit() to return RLIM_INFINITY
-+        # as the unsigned 2**64-1 instead of -1; psutil maps it back.
-+        unsigned = 2**64 - 1
-+        p = psutil.Process()
-+        with mock.patch(
-+            "psutil._pslinux.resource.prlimit",
-+            return_value=(unsigned, unsigned),
-+        ) as m:
-+            soft, hard = p.rlimit(psutil.RLIMIT_FSIZE)
-+            assert m.called
-+        assert soft == psutil.RLIM_INFINITY
-+        assert hard == psutil.RLIM_INFINITY
-+
+--- psutil-7.2.2.orig/psutil/arch/posix/init.c
++++ psutil-7.2.2/psutil/arch/posix/init.c
+@@ -107,8 +107,6 @@ psutil_posix_add_constants(PyObject *mod
+ #endif
+ 
+ #if defined(PSUTIL_LINUX) || defined(PSUTIL_FREEBSD)
+-    PyObject *v;
+-
+ #ifdef RLIMIT_AS
+     if (PyModule_AddIntConstant(mod, "RLIMIT_AS", RLIMIT_AS))
+         return -1;
+@@ -208,19 +206,6 @@ psutil_posix_add_constants(PyObject *mod
+         return -1;
+ #endif
+ 
+-#if defined(HAVE_LONG_LONG)
+-    if (sizeof(RLIM_INFINITY) > sizeof(long)) {
+-        v = PyLong_FromLongLong((PY_LONG_LONG)RLIM_INFINITY);
+-    }
+-    else
+-#endif
+-    {
+-        v = PyLong_FromLong((long)RLIM_INFINITY);
+-    }
+-    if (v) {
+-        if (PyModule_AddObject(mod, "RLIM_INFINITY", v))
+-            return -1;
+-    }
+ #endif  // defined(PSUTIL_LINUX) || defined(PSUTIL_FREEBSD)
  
- @pytest.mark.skipif(not LINUX, reason="LINUX only")
- class TestUtils(PsutilTestCase):
+     return 0;
+Index: psutil-7.2.2/tests/test_process.py
+===================================================================
+--- psutil-7.2.2.orig/tests/test_process.py
++++ psutil-7.2.2/tests/test_process.py
+@@ -24,6 +24,7 @@ import subprocess
+ import sys
+ import textwrap
+ import time
++import warnings
+ from unittest import mock
+ 
+ import psutil
+@@ -363,7 +364,10 @@ class TestProcess(PsutilTestCase):
+         soft, hard = p.rlimit(psutil.RLIMIT_FSIZE)
+         try:
+             p.rlimit(psutil.RLIMIT_FSIZE, (1024, hard))
+-            p.rlimit(psutil.RLIMIT_FSIZE, (psutil.RLIM_INFINITY, hard))
++            # Python 3.15 deprecates negative limits
++            with warnings.catch_warnings():
++                warnings.simplefilter("error")
++                p.rlimit(psutil.RLIMIT_FSIZE, (psutil.RLIM_INFINITY, hard))
+             with open(self.get_testfn(), "wb") as f:
+                 f.write(b"X" * 2048)
+         finally:
+@@ -382,6 +386,12 @@ class TestProcess(PsutilTestCase):
+         assert hard == psutil.RLIM_INFINITY
+         p.rlimit(psutil.RLIMIT_FSIZE, (soft, hard))
+ 
++    @pytest.mark.skipif(not HAS_RLIMIT, reason="not supported")
++    def test_rlimit_infinity_matches_resource(self):
++        import resource
++
++        assert psutil.RLIM_INFINITY == resource.RLIM_INFINITY
++
+     @pytest.mark.xdist_group(name="serial")
+     def test_num_threads(self):
+         # on certain platforms such as Linux we might test for exact
 

Reply via email to