You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue is created after the discussions in #390 (comment)
The existing argument exp_sig for executors assumes full POSIX compliance of the called executable, because the expected return code is assumed to be the negation of the signal code. This assumes a cooperating executable being called that follows the convention of negating the received signal. In my case, I am running a Click executable with SimpleExecutor. Click, by default, always returns 1 on unhandled signals and in this case also the returncode is then 1. This can easily be verified with:
This is unfortunate because now I have to specify exp_sig=-1 to avoid the process execution exception, but the statement conveys a different meaning than what is actually done now.
I would propose to drop this argument (or to provide a second one for backwards-compatibility) that is called expected_returncode(s). This argument wouldn't do any negation magic. Something like SimpleExecutor("prog", expected_returncode=1) is also pretty easy to understand.
The text was updated successfully, but these errors were encountered:
I need to put that in my mind what I think I'll do:
We'll drop exp_sig alltogether.
If someone passes expected_returncode, we'll check for that, otherwise we'll attempt to guess it assuming POSIX compatibility. This will also benefit windows builds/attempts, I think 🤔
This issue is created after the discussions in #390 (comment)
The existing argument
exp_sig
for executors assumes full POSIX compliance of the called executable, because the expected return code is assumed to be the negation of the signal code. This assumes a cooperating executable being called that follows the convention of negating the received signal. In my case, I am running a Click executable with SimpleExecutor. Click, by default, always returns1
on unhandled signals and in this case also thereturncode
is then 1. This can easily be verified with:executed.py
:executor.py
:This is unfortunate because now I have to specify
exp_sig=-1
to avoid the process execution exception, but the statement conveys a different meaning than what is actually done now.I would propose to drop this argument (or to provide a second one for backwards-compatibility) that is called
expected_returncode(s)
. This argument wouldn't do any negation magic. Something likeSimpleExecutor("prog", expected_returncode=1)
is also pretty easy to understand.The text was updated successfully, but these errors were encountered: