]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-154326: Fix test_fsize_not_too_big() on Solaris (GH-154329)
authorSerhiy Storchaka <storchaka@gmail.com>
Tue, 21 Jul 2026 06:39:44 +0000 (09:39 +0300)
committerGitHub <noreply@github.com>
Tue, 21 Jul 2026 06:39:44 +0000 (06:39 +0000)
Solaris silently converts resource limits that do not fit in a signed
64-bit integer to RLIM_INFINITY.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Lib/test/test_resource.py

index 6ea27c463f3148462a9f3810dc5c42e65cf1bdff..97d2ae4e33c548bf3c49719abf2170c0fce7e673 100644 (file)
@@ -99,6 +99,11 @@ class ResourceTest(unittest.TestCase):
             # silently converted the limit value to RLIM_INFINITY.
             if sys.maxsize < 2**32 <= cur <= resource.RLIM_INFINITY:
                 return [(resource.RLIM_INFINITY, max), (cur, max)]
+            # Solaris silently converts limits that do not fit in a signed
+            # 64-bit integer to RLIM_INFINITY.
+            if cur >= 2**63-1:
+                return [(resource.RLIM_INFINITY, max),
+                        (min(cur, resource.RLIM_INFINITY), max)]
             return [(min(cur, resource.RLIM_INFINITY), max)]
 
         resource.setrlimit(resource.RLIMIT_FSIZE, (2**31-5, max))