MorseKOB / PyKOB

Python implementation of a library for Morse and MorseKOB functionality
https://sites.google.com/site/morsekob/morsekob40
MIT License
4 stars 2 forks source link

Add 'KeyboardInterrupt' handlers to all applications/commands #15

Closed AESilky closed 4 years ago

AESilky commented 4 years ago

The PyKOB applications/commands (Time.py, News.py, etc.) should gracefully handle the KeyboardInterrupt to exit.

Currently, many of the apps/commands produce a Traceback when ^C is used to exit.

leskerr commented 4 years ago

I agree this should be done. The only reason I never handled Ctrl-C more gracefully is due to laziness on my part and lack of requests from users.

pwdirks commented 4 years ago

Well, you've got two picky users now who've been spoiled by long exposure to proper ^C handling... :-)

leskerr commented 4 years ago

Actually, just one picky user is all it takes to convince me! :-)

On Tue, Apr 28, 2020 at 6:30 PM Patrick Dirks notifications@github.com wrote:

Well, you've got two picky users now who've been spoiled by long exposure to proper ^C handling... :-)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/MorseKOB/pykob-4/issues/15#issuecomment-620940498, or unsubscribe https://github.com/notifications/unsubscribe-auth/APHISTJ6QK4ETIE4LQ7EKPLRO57LVANCNFSM4MRZK47Q .

AESilky commented 4 years ago

In writing commercial software (at IBM, TRIRIGA, Oracle, PeopleSoft, Calico) we were never allowed to display a stack-trace to an end user. That is considered a security vulnerability. If testing or users ever get a stack-trace it is a priority 1 (critical) issue and must be fixed immediately. We even had a function in our logging that would 'scrub' a stack-trace before it was written to a logfile to remove PII and other information.

I know this isn't commercial software, but I would like to take care of these as we have a chance to. It shouldn't be hard (an encompassing try on the user processing code.

AESilky commented 4 years ago

@pwdirks I noticed updates to many files (as conflicts to my issue #12). Do those changes complete/close this issue, or are there still some apps to update?

pwdirks commented 4 years ago

Yeah - sorry; wrapping large bodies of code in a try ... except block unfortunately changed the indentation on a lot of code you must've changed for #12 as well. If you can do a comparison ignoring blank space changes you should find the differences almost negligible but I don't know if the merge tool works strictly on whole lines or is smart enough to merge in only the extra indentation I had to add.

In any case, that merge completed this issue.