[ python-Bugs-1045509 ] Problems with os.system and ulimit -f

SourceForge.net noreply at sourceforge.net
Fri Oct 22 13:52:33 CEST 2004


Bugs item #1045509, was opened at 2004-10-12 12:34
Message generated for change (Comment added) made by kowaltowski
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1045509&group_id=5470

Category: Python Interpreter Core
>Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: Tomasz Kowaltowski (kowaltowski)
Assigned to: Nobody/Anonymous (nobody)
Summary: Problems with os.system and ulimit -f

Initial Comment:
Python version (running under Fedora Core 2 Linux):
   Python 2.3.3 (#1, May  7 2004, 10:31:40)
   [GCC 3.3.3 20040412 (Red Hat Linux 3.3.3-7)] on linux2
---------------------------------------------------------------------------
I found a problem while executing the 'ulimit -f' bash
command within the 'os.system' function. According to
the documentation this function should behave exactly
like the stdlib function 'system'. However it does not
happen as illustrated by the minimal Python and C
examples: testsystem.py and testsystem.c (see attached
zipped file).

In these examples 'largefile' is a compiled C program
which writes an endless file into the stdout (also
attached). The C program testsystem.c works as expected
and prints the following output:

   command: ulimit -f 10; largefile > xxx;
   result = 153

The Python program testsystem.py **does not stop**; if
interrupted by Ctrl-C it prints:

  command: ulimit -f 10; largefile > xxx;
  result = 0

In both cases the output file 'xxx' has 10240 bytes,
ie, 10 blocks as limited by 'ulimit'. 

It is interesting though that the command 'ulimit -t 1'
(CPU time) produces correct results under both Python
and C versions, ie, interrupts the execution and prints:

  command: ulimit -t 1; largefile > xxx;
  result = 137






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

>Comment By: Tomasz Kowaltowski (kowaltowski)
Date: 2004-10-22 09:52

Message:
Logged In: YES 
user_id=185428

I also tested the new version "Python 2.4b1" -- the problem
still occurs :-(.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1045509&group_id=5470


More information about the Python-bugs-list mailing list