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-06 19:34:03 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-psutil (Old) and /work/SRC/openSUSE:Factory/.python-psutil.new.3759290 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-psutil" Fri Nov 6 19:34:03 2026 rev:93 rq:1395125 version:7.2.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-psutil/python-psutil.changes 2026-05-24 19:34:38.224781418 +0200 +++ /work/SRC/openSUSE:Factory/.python-psutil.new.3759290/python-psutil.changes 2026-11-06 19:37:12.094010604 +0100 @@ -1,0 +2,5 @@ +Thu Nov 5 09:54:12 UTC 2026 - Markéta Machová <[email protected]> + +- Add rlim_infinity.patch to fix compatibility with Python 3.15 + +------------------------------------------------------------------- New: ---- rlim_infinity.patch ----------(New B)---------- New: - Add rlim_infinity.patch to fix compatibility with Python 3.15 ----------(New E)---------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-psutil.spec ++++++ --- /var/tmp/diff_new_pack.2lAOR3/_old 2026-11-06 19:37:14.056092677 +0100 +++ /var/tmp/diff_new_pack.2lAOR3/_new 2026-11-06 19:37:14.058092760 +0100 @@ -36,6 +36,8 @@ 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: rlim_infinity.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} ++++++ rlim_infinity.patch ++++++ >From b408cfc0a05266a0509ccbb13e253f2d2000ed9f 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) `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(-) Index: psutil-7.2.2/psutil/_pslinux.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 + # "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 =================================================================== --- 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 + @pytest.mark.skipif(not LINUX, reason="LINUX only") class TestUtils(PsutilTestCase):
