gh-137044: Make resource.RLIM_INFINITY always positive#137511
gh-137044: Make resource.RLIM_INFINITY always positive#137511serhiy-storchaka merged 3 commits intopython:mainfrom
Conversation
It is now a positive integer larger larger than any limited resource value. This simplifies comparison of the resource values. Previously, it could be negative, such as -1 or -3, depending on platform.
encukou
left a comment
There was a problem hiding this comment.
OK, let's do this. It's the practical thing to do; if there are platforms that conform to POSIX in more interesting ways then we'll hopefullly notice in the 3.15 cycle.
| :data:`resource.RLIM_INFINITY` is now always a positive integer larger than | ||
| any limited resource value. This simplifies comparison of the resource | ||
| values. Previously, it could be negative, such as -1 or -3, depending on | ||
| platform. |
There was a problem hiding this comment.
I don't think we test/guarantee that RLIM_INFINITY is bigger than limited values. AFAIK, POSIX would have no problem with RLIM_INFINITY being zero.
So, this should be:
| :data:`resource.RLIM_INFINITY` is now always a positive integer larger than | |
| any limited resource value. This simplifies comparison of the resource | |
| values. Previously, it could be negative, such as -1 or -3, depending on | |
| platform. | |
| :data:`resource.RLIM_INFINITY` is now always a positive integer. | |
| Previously, it could be negative, such as -1 or -3, depending on | |
| platform. |
or:
| :data:`resource.RLIM_INFINITY` is now always a positive integer larger than | |
| any limited resource value. This simplifies comparison of the resource | |
| values. Previously, it could be negative, such as -1 or -3, depending on | |
| platform. | |
| :data:`resource.RLIM_INFINITY` is now always a positive integer. | |
| On supported platforms, it is larger than any limited resource value, | |
| which simplifies comparison of the resource values. | |
| Previously, it could be negative, such as -1 or -3, depending on | |
| platform. |
There was a problem hiding this comment.
https://pubs.opengroup.org/onlinepubs/9799919799/functions/getrlimit.html
The value RLIM_INFINITY, defined in <sys/resource.h>, shall be considered to be larger than any other limit value.
There was a problem hiding this comment.
To be clear, I do not think this should have been merged without this change.
|
This seems to have broken |
…ythonGH-137511)" This reverts commit 0324c72.
|
Test fix: #137941. |
…H-137511) It is now a positive integer larger larger than any limited resource value. This simplifies comparison of the resource values. Previously, it could be negative, such as -1 or -3, depending on platform. Deprecation warning is emitted if the old negative value is passed.
It is now a positive integer larger than any limited resource value. This simplifies comparison of the resource values. Previously, it could be negative, such as -1 or -3, depending on platform.