[Patches] [ python-Patches-551960 ] Add check for setrlimit() support

noreply@sourceforge.net noreply@sourceforge.net
Sun, 02 Jun 2002 10:53:45 -0700


Patches item #551960, was opened at 2002-05-03 20:18
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=551960&group_id=5470

Category: Tests
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gerald S. Williams (gsw_agere)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add check for setrlimit() support

Initial Comment:
The new test_resource test calls resource.setrlimit() 
to change the file size limits. This fails on Cygwin, 
which supports setrlimit() and getrlimit(), just not 
changing that particular setting. (The same would 
apply to any other platforms that has those functions 
but not that particular feature.)

Since that getrlimit() works, and setrlimit() can be 
used for other reasons, a check for sys.platform was 
added to that part of the test.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-06-02 19:53

Message:
Logged In: YES 
user_id=21627

I'm not sure I understand the logic in the modified
setrlimit(FSIZE) case. If setting the limit fails, it seems
that the entire test should be skipped. Raising TestSkipped
might be appropriate, to indicate that the result of the
test is not trustworthy.

----------------------------------------------------------------------

Comment By: Gerald S. Williams (gsw_agere)
Date: 2002-05-06 15:11

Message:
Logged In: YES 
user_id=329402

Cygwin Python raises ValueError when you call setrlimit() 
for RLIMIT_FSIZE. That limit is hardcoded at infinity and 
cannot be changed. I have submitted an alternative patch 
that looks for ValueError rather than checking sys.platform.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-05-06 10:44

Message:
Logged In: YES 
user_id=21627

Don't check for systems, check for features instead.

In this specific case, what error does Cygwin report? Could
that be used to deal with the missing feature in a more
general way?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=551960&group_id=5470