[issue42648] subprocess: add a helper/parameter to catch exec() OSError exception

STINNER Victor report at bugs.python.org
Tue Dec 15 18:25:01 EST 2020


STINNER Victor <vstinner at python.org> added the comment:

I wrote PR 23790 which adds exec_raise=True parameter to subprocess.Popen. exec_raise=False avoids try/except OSError.

I dislike the "exec_raise" parameter name. The function is not related to exec, but more specific to OSError. A better name may include "oserror", like "catch_oserror"?

The shutil.rmtree() has a "onerror" parameter. I don't know if it's a good inspiration for this feature.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42648>
_______________________________________


More information about the Python-bugs-list mailing list