[issue9917] resource max value represented as signed when should be unsigned

2021-12-16 Thread Daniel Diniz


Change by Daniel Diniz :


--
versions: +Python 3.10, Python 3.11, Python 3.9 -Python 2.7, Python 3.4, Python 
3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2019-02-24 Thread Mark Lawrence


Change by Mark Lawrence :


--
nosy:  -BreamoreBoy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2015-12-05 Thread Martin Panter

Martin Panter added the comment:

Are there platforms where rlim_t is signed? Posix defines it as unsigned: 
.

Also there are subtle differences between the PyLong_AsUnsigned[. . .] and the 
current signed versions. The unsigned version does not call __int__() so you 
would no longer be able to pass a float().

Also this could cause compatibility problems with code that was written for 
earlier documentation, which said to use -1 to mean unlimited. Perhaps that is 
why the code has rlim_* & RLIM_INFINITY masking.

--
components: +Extension Modules -Library (Lib)
nosy: +martin.panter
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2015-09-28 Thread Arnon Yaari

Arnon Yaari added the comment:

I'm submitting a patch for review. I tested this and verified the values on 
Redhat and Unbuntu (both x86 and x64), Mac OS X (x64) and AIX (32-bit process 
on ppc64).
'configure' and 'pyconfig.h.in' were auto-generated with autoconf and 
autoheader, respectively.
A test for this patch (along with a fix for a different test failure) is in 
msg117130

--
keywords: +patch
Added file: http://bugs.python.org/file40613/issue9917.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2015-09-28 Thread Arnon Yaari

Arnon Yaari added the comment:

getrlimit still returns -1 as 'max' when limit is unlimited and for 
RLIM_INFINITY because rlim_t is considered signed.

The zshell project decides whether rlim_t is signed/unsigned (and also whether 
it is long or long long) in the configure step: 
https://github.com/zsh-users/zsh/blob/8b84419f45298ee564bd6fa2b531c8991b2a1983/configure.ac#L1859

On Linux, rlim_t is unisnged long long so the conversion should be done using 
PyLong_FromUnsignedLongLong (for RLIM_INFINITY) and using 'KK' instead of 'LL' 
in 'rlimit2py'.

IMHO the best way to fix this is to add configure steps like in zsh and then 
adding ifdefs to resource.c - in rlimit2py and near PyModule_AddObject of 
RLIM_INFINITY

--
nosy: +wiggin15

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2015-08-07 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2014-09-30 Thread Mark Lawrence

Mark Lawrence added the comment:

@David one for your TODO list or does this rightfully belong with somebody else?

--
nosy: +BreamoreBoy
versions: +Python 3.4, Python 3.5 -Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2010-09-22 Thread R. David Murray

R. David Murray  added the comment:

And here is Martin's summary of the issue:

I think we really should create new issues for any remaining problems.

AFAICT, the remaining problems are:
- resource.RLIM_INFINITY is -1 on Linux, when it is meant to be
   a really large value
- (as you reported) getrlimit returns -1 to indicate RLIM_INFINITY.

I think the core of the problem is that the resource module considers
rlim_t to be a signed type (or at least representable in "long long").
Using FromUnsignedLongLong in the appropriate place might solve the
issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9917] resource max value represented as signed when should be unsigned

2010-09-21 Thread R. David Murray

New submission from R. David Murray :

Breaking out the library bug discussed in issue 678264 from the test bug the 
issue is about.

See msg14344 and msg116479.

--
components: Library (Lib)
messages: 117123
nosy: ajaksu2, loewis, mdr0, nnorwitz, r.david.murray, sable
priority: normal
severity: normal
stage: needs patch
status: open
title: resource max value represented as signed when should be unsigned
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com