Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 81951 - EINTR for commands.getoutput()
EINTR for commands.getoutput()
Product: Red Hat Public Beta
Classification: Retired
Component: python (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Mihai Ibanescu
Brock Organ
Depends On:
Blocks: 79579
  Show dependency treegraph
Reported: 2003-01-15 13:25 EST by Harald Hoyer
Modified: 2007-04-18 12:50 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-02-03 04:56:59 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Harald Hoyer 2003-01-15 13:25:28 EST
commands.getoutput() does 
#define EINTR            4      /* Interrupted system call */

This doesn't make any sense to me..

  File "./netconfpkg/NCDevice.py", line 282, in save
    broadcast = commands.getoutput('ipcalc --broadcast ' + \
  File "//usr/lib/python2.2/commands.py", line 44, in getoutput
    return getstatusoutput(cmd)[1]
  File "//usr/lib/python2.2/commands.py", line 54, in getstatusoutput
    text = pipe.read()
IOError: [Errno 4] Interrupted system call
Comment 1 Mihai Ibanescu 2003-01-17 15:54:55 EST
Not sure I understand - what is the problem?
Comment 2 Harald Hoyer 2003-01-20 05:55:57 EST
  File "//usr/lib/python2.2/commands.py", line 54, in getstatusoutput
    text = pipe.read()
IOError: [Errno 4] Interrupted system call

seems like pipe.read() gets interrupted ... this must not happen!
Comment 3 Mihai Ibanescu 2003-01-21 08:14:42 EST
Why don't you try-except it? This is what you're supposed to do anyway - there
are plenty of other problems that can happen and could raise IOError, besides
EINTR. You do that in a C program - why can't you do it in python?

It's arguable if python, as a high-level language, should hide or propagate this
error upstream - but exception handling is usually a good practice.

Comment 4 Harald Hoyer 2003-01-21 08:19:15 EST
it is correct that I should catch the exceptions.. I did, and always wondered
why the execution failed there and then... this is strange behaviour, cause 1
minute later it workx.. do you want a testcase?
Comment 5 Mihai Ibanescu 2003-01-21 08:22:19 EST
Sure, please attach it. I'd like to see how python 1.5.2 behaves, as well as
python 2.2.2 on pre-Phoebe.
Comment 6 Mihai Ibanescu 2003-01-31 12:39:38 EST
Harald, does this still happen?
Comment 7 Harald Hoyer 2003-02-03 04:56:59 EST
no, thx... haven't seen that. Must have been the kernel.

Note You need to log in before you can comment on or make changes to this bug.