https://github.com/python/cpython/commit/0fd12095b3174bb3e622f07604fe0e9a57509863
commit: 0fd12095b3174bb3e622f07604fe0e9a57509863
branch: 3.15
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-07-21T10:17:48+03:00
summary:

[3.15] gh-154326: Fix test_fsize_not_too_big() on Solaris (GH-154329) 
(GH-154334)

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 <[email protected]>
Co-authored-by: Claude Opus 4.8 <[email protected]>

files:
M Lib/test/test_resource.py

diff --git a/Lib/test/test_resource.py b/Lib/test/test_resource.py
index ba736b0806eb1b..9834b36043355b 100644
--- a/Lib/test/test_resource.py
+++ b/Lib/test/test_resource.py
@@ -99,6 +99,11 @@ def expected(cur):
             # 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))

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to