It looks like you combining checks on CalledProcessError here into OSError which you recast as an IOError, any reason why?