KeyboardInterrupt Exception not handled after pushing Ctrl-C
-
Version; MicroPython v1.8.6-251-g2fb950d on 2016-12-16; LoPy with ESP32
The KeyboardInterrupt Exception is not handled as such, and not as another exception type.
he follwoin small piece of code should catch Ctr-C, but it does. Other ports of MicroPython work properly, and even the WiPy 1 port does at least not terminate (it ignores Ctrl-C)import sys while (True): try: c=sys.stdin.read(1) sys.stdout.write(c) except KeyboardInterrupt: print("received keyboard interrupt") except: print("Got another interrupt") if c == "q": break -
Hi @robert-hh,
I tested it and this seems to be a bug in the firmware. I can't seem to catch the keyboardinterrupt. On the WiPy 1.0 it does work.
I added this bug to Github issues now, you can find it here. If you find more specific bugs like this in the future, please post it there.
Regards,
Ralph -
Thanks @Ralph. On WIpy 1 there is however a little inconvenience in that the keyboard interrupt is not flagged immediately, but only after another character is typed. This behavior exists since ever, I reported it but it was never fixed.
Best regards, Robert
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login