Skip to content

return value of system() function #48

seongsu opened this Issue Aug 22, 2011 · 0 comments

2 participants

seongsu commented Aug 22, 2011


I found that the system() function in Dumbo always returns zero if the actual return value is less than 256. As you know, command 'hadoop fs -test -e' returns 1 if the given path do not exists. But the system() function returns zero in the case. I think '/ 256' should be removed in the code.

def system(cmd, stdout=sys.stdout, stderr=sys.stderr):
    if sys.version[:3] == '2.4':
        return os.system(cmd) / 256
    proc = subprocess.Popen(cmd, shell=True, stdout=stdout,
    return os.waitpid(, 0)[1] / 256

Please let me know what you think of this. Thanks.

@klbostee klbostee was assigned Sep 9, 2011
@klbostee klbostee pushed a commit that closed this issue Sep 9, 2011
Klaas Bosteels don't divide system()'s return values by 256 (fixes #48) cbf8d9a
@klbostee klbostee closed this in cbf8d9a Sep 9, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.