Where can I find information about meaning of exit codes of “python” process on Unix? For instance, if I do “python thisfiledoesntexist.py”, I get exit code 2
Summary:
from errno import errorcode
print errorcode[2]
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As stated, mostly the error codes come from the executed script and
sys.exit().The example with a non-existing file as an argument to the interpreter fall in a different category. Though it’s stated nowhere I would guess, that these exit codes are the "standard" Linux error codes. There is a module called
errnothat provides these error numbers (the exit codes come fromlinux/include/errno.h.I.e.:
errno.ENOENT(stands for for "No such file or directory") has the number 2 which coincides with your example.