-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CLI scripting not handling Ctrl+C KeyboardInterrupt #562
Comments
I've tried to reproduce this using ykman 5.2.0, but I haven't been able to. It might be that it was already fixed since 5.0.1, could you give 5.2.0 a try? |
@dainnilsson I've installed 5.2.0 from the macOS package in GitHub releases, and can't reproduce the issue 🎉 Looking at the comparison between release/5.0.1...release/5.2.0 I can't see anything obvious that would have impacted this, but at least it works, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Steps to reproduce
Running the following example code using
ykman script
will not break the loop:Expected result
Pressing
Ctrl+C
breaks out of the loop.Actual results and logs
Pressing
Ctrl+C
printsExiting due to signal 2
and the loop continues.From the example script, good behaviour when running directly with python:
Running the example script through ykman, bad behaviour and has to be terminated by
kill <pid>
:$ ./ykman script -f ~/Downloads/break.py Sleeping looping Sleeping looping Sleeping ^CExiting due to signal 2 looping Sleeping ^CExiting due to signal 2 looping Sleeping looping Sleeping [1] 89895 terminated ./ykman script -f break.py
Other info
This simplified example comes from trying to programme multiple OTP keys using the yubiotp_batch.py script. I found that it's impossible to break using
Ctrl+C
and the CSV file was never written and closed.This seems to be because
s.multi
is always waiting for another device, which is why the test case above is just a copy of the loop's try/except:yubikey-manager/ykman/scripting.py
Line 148 in d682eb9
I can't see anything immediately obvious as to why this happens, as it seems that the script is just given to
exec
:yubikey-manager/ykman/_cli/script.py
Line 105 in d682eb9
Replicating that behaviour as well directly in python doesn't cause the issue, so I assume there must be some other intercept somewhere in ykman.
The text was updated successfully, but these errors were encountered: