On this JIRA ticket
I suggest that we add:
When an API is used that provides a means for returning an error indication, the invoking code shall perform a check for errors.
In particular, when invoking POSIX library functions or system calls, the return value shall always be checked for an error condition, and if an error condition is found, the value of errno should generally be preserved or reported in some form, unless a specific value of errno is expected as part of the normal operation of an algorithm.
Rationale: In general it is clear that if you invoke a function, you want to know whether it claims to have done what you asked. It is true that in casual coding there are some commonly used library functions that will very rarely return an error, and there are traditions in various communities of not checking in these cases. However, in a large production project it is preferable to make error-checking a blanket rule because even extremely unlikely error conditions have a way of happening at some point, and the error check may provide the only clue for the cause of a rare failure.
to the programming standards. I am thinking primarily of C++ but the principle applies mutatis mutandi to Python.