[New-bugs-announce] [issue17409] resource.setrlimit doesn't respect -1

Paul Price report at bugs.python.org
Wed Mar 13 16:18:35 CET 2013


New submission from Paul Price:

The docs for resource.setrlimit (http://docs.python.org/2.7/library/resource.html#resource.setrlimit) state: "The limits argument must be a tuple (soft, hard) of two integers describing the new limits. A value of -1 can be used to specify the maximum possible upper limit."

On Mac OSX (10.7.5) with Python 2.7.3 (built fresh), I get the following behaviour:


$ PATH=$HOME/test/bin:$PATH DYLD_LIBRARY_PATH=$HOME/test/lib:$DYLD_LIBRARY_PATH python
Python 2.7.3 (default, Mar 13 2013, 11:02:56) 
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.9.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import resource
>>> resource.setrlimit(resource.RLIMIT_NOFILE, (10, -1))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: not allowed to raise maximum limit
>>> resource.setrlimit(resource.RLIMIT_NOFILE, (10, 10))
>>> 


I get the same behaviour for the system python (2.7.3 built with GCC 4.6.3) in Ubuntu 12.04.1.

----------
messages: 184086
nosy: Paul.Price
priority: normal
severity: normal
status: open
title: resource.setrlimit doesn't respect -1
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17409>
_______________________________________


More information about the New-bugs-announce mailing list