This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: subprocess.CalledProcessError uses errno incorrectly
Type: Stage:
Components: None Versions: Python 2.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: astrand Nosy List: astrand, hoffman
Priority: normal Keywords:

Created on 2005-12-08 14:14 by hoffman, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (3)
msg26999 - (view) Author: Michael Hoffman (hoffman) Date: 2005-12-08 14:14
I have some code which uses subprocess.check_call(),
which is buried in other code that catches an OSError,
and does different things depending on OSError.errno.
Since subprocess.CalledProcessError overloads errno for
its own return code values, this leads to confusing
error messages.

The return code is NOT an errno, and I do not think
this field should be overloaded in this way.
Additionally, since OSError exceptions generally have
an errno attribute set, and exception-handling code
expects this, I do not think that CalledProcessError
should subclass from it.
msg27000 - (view) Author: Michael Hoffman (hoffman) Date: 2005-12-08 14:27
Logged In: YES 
user_id=987664

Ugh, this was supposed to be a bug, not a patch. Is there
anyway to change this or should I just resumbit?
msg27001 - (view) Author: Peter Åstrand (astrand) * (Python committer) Date: 2006-07-10 20:33
Logged In: YES 
user_id=344921

Duplicate of 1223937. 
History
Date User Action Args
2022-04-11 14:56:14adminsetgithub: 42669
2005-12-08 14:14:50hoffmancreate