]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.15] gh-154326: Fix test_fsize_not_too_big() on Solaris (GH-154329) (GH-154334)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 21 Jul 2026 07:17:48 +0000 (09:17 +0200)
committerGitHub <noreply@github.com>
Tue, 21 Jul 2026 07:17:48 +0000 (10:17 +0300)
Solaris silently converts resource limits that do not fit in a signed
64-bit integer to RLIM_INFINITY.
(cherry picked from commit 202c4c88ed5cb68ba41c54ad91e99c5585debdb4)

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

index ba736b0806eb1b03b78c2f4a7d8a86f0d1c4f071..9834b36043355b0a4bbd8f61bc127f9633b6851f 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))