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

2013-04-20 Thread Paul Price
Paul Price added the comment: Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org

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

2013-04-20 Thread R. David Murray
R. David Murray added the comment: There being no objection :) I've committed the patch. -- resolution: -> fixed stage: commit review -> committed/rejected status: open -> closed ___ Python tracker ___

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

2013-04-20 Thread Roundup Robot
Roundup Robot added the comment: New changeset 186f6bb3e46a by R David Murray in branch '3.3': #17409: Document RLIM_INFINITY and use it to clarify the setrlimit docs. http://hg.python.org/cpython/rev/186f6bb3e46a New changeset 9c4db76d073e by R David Murray in branch '2.7': #17409: Document RLI

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

2013-03-21 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://

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

2013-03-21 Thread R. David Murray
R. David Murray added the comment: How about this. -- Added file: http://bugs.python.org/file29538/setrlimit_doc.patch ___ Python tracker ___

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

2013-03-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: Both old and new have this sentence: "Raises :exc:`ValueError` if an invalid resource is specified, if the new soft limit exceeds the hard limit, or if a process tries to raise its hard limit (unless the process has an effective UID of super-user)." This strik

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

2013-03-21 Thread R. David Murray
R. David Murray added the comment: Here's a patch that adds RLIMIT_INFINITY and uses it. This constant exists in 2.7 and Python3, but has not been previously documented. -- Added file: http://bugs.python.org/file29535/setrlimit_doc.patch ___ Python

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

2013-03-21 Thread R. David Murray
R. David Murray added the comment: Terry: well, we're trying to deal with the fact that the setrlimit man page says: The value RLIM_INFINITY denotes no limit on a resource (both in the structure returned by getrlimit() and in the structure passed to setr- limit()). Oh

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

2013-03-21 Thread Terry J. Reedy
Terry J. Reedy added the comment: in-finite literally means un-limited or un-bounded. However, 'infinte' has also taken on the meaning of 'actual infinity'. So in my algorithms book, when 'actual infinities' are not in play. I describe the set of counts as unbounded. I suggest you go with just

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

2013-03-21 Thread Paul Price
Paul Price added the comment: You missed out an "is": Raises :exc:`ValueError` if an invalid resource is specified, if the new soft limit exceeds the hard limit, or if a process tries to raise its hard limit (unless the process has an effective UID of super-user). Specifying an infi

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

2013-03-21 Thread R. David Murray
R. David Murray added the comment: Here's another attempt, using infinite/unlimited . I noticed that the following paragraph talks specifically about the error raised, so I moved the explanation to that paragraph. -- Added file: http://bugs.python.org/file29534/setrlimit_doc.patch __

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

2013-03-21 Thread R. David Murray
R. David Murray added the comment: infinite/unlimited sounds like a good compromise :) Yes, I left NOFILE out on purpose, because the issue applies to any resource that is not unlimited for whatever reason. -- ___ Python tracker

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

2013-03-21 Thread Paul Price
Paul Price added the comment: That's good; it doesn't have what I added to the description of RLIMIT_NOFILE, but perhaps you chose to leave that out on purpose. Since both "unlimited" and "infinite" are both used in different contexts, perhaps we should use both, e.g., "infinite/unlimited"? -

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

2013-03-21 Thread R. David Murray
R. David Murray added the comment: Thanks for the patch. You got the patch mechanics correct. I did a little experimenting, and at least on my linux box, the exception is raised for any(*) resource whose hard limit is not unlimited. I'm attaching a revised patch that expresses this. Do you

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

2013-03-21 Thread Paul Price
Paul Price added the comment: P.S. This is relative to the 'default' branch in the public cpython. -- ___ Python tracker ___ ___ Pytho

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

2013-03-21 Thread Paul Price
Paul Price added the comment: Not sure how you want patches formatted, so I went for 'git format-patch'. Also, this is my first attempt at writing ReST and my first attempt at writing docs for Python, so you may want to double-check I didn't screw up the syntax or style. Hopefully this doesn'

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

2013-03-18 Thread R. David Murray
R. David Murray added the comment: That would be great, thanks. -- assignee: -> docs@python components: +Documentation nosy: +docs@python versions: +Python 3.2, Python 3.3, Python 3.4 ___ Python tracker __

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

2013-03-18 Thread Paul Price
Paul Price added the comment: The OSX manpage for setrlimit includes: COMPATIBILITY setrlimit() now returns with errno set to EINVAL in places that histori- cally succeeded. It no longer accepts "rlim_cur = RLIM_INFINITY" for RLIM_NOFILE. Use "rlim_cur = min(OPEN_MAX, rlim_max)"

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

2013-03-17 Thread Kushal Das
Kushal Das added the comment: On Fedora 17, x86_64 ./python Python 3.4.0a0 (default:fb50eb64e097, Feb 22 2013, 11:43:18) [GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import resource [92450 refs, 32257 blocks] >>> res

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

2013-03-15 Thread Terry J. Reedy
Terry J. Reedy added the comment: Module 'resource' is unix only. What happens on 3.x or linux? Given that the doc invites input of -1, it seems to me that raising an exception is wrong; -1 should be interpreted as a valid value. -- nosy: +terry.reedy

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

2013-03-13 Thread R. David Murray
R. David Murray added the comment: Since it says "maximum possible limit", I think -1 is the maximum system limit, not the maximum value a particular process is allowed to use. If that is true the error message is presumably accurate. And if that's true it needs to be clarified in the docs..

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

2013-03-13 Thread Paul Price
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 up