From: Serhiy Storchaka Date: Tue, 21 Jul 2026 06:39:44 +0000 (+0300) Subject: gh-154326: Fix test_fsize_not_too_big() on Solaris (GH-154329) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=202c4c88ed5cb68ba41c54ad91e99c5585debdb4;p=thirdparty%2FPython%2Fcpython.git gh-154326: Fix test_fsize_not_too_big() on Solaris (GH-154329) 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 --- diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py index 6ea27c463f31..97d2ae4e33c5 100644 --- a/Lib/test/test_resource.py +++ b/Lib/test/test_resource.py @@ -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))