Skip to content
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

Codespell don't handle KeyboardInterrupt exception #3217

Closed
jcubic opened this issue Nov 14, 2023 · 0 comments · Fixed by #3218
Closed

Codespell don't handle KeyboardInterrupt exception #3217

jcubic opened this issue Nov 14, 2023 · 0 comments · Fixed by #3218

Comments

@jcubic
Copy link
Contributor

jcubic commented Nov 14, 2023

This should be catched and the program should stop gracefully but instead show default stack trace:

^CTraceback (most recent call last):
  File "/home/kuba/.local/bin/codespell", line 8, in <module>
    sys.exit(_script_main())
             ^^^^^^^^^^^^^^
  File "/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py", line 1017, in _script_main
    return main(*sys.argv[1:])
           ^^^^^^^^^^^^^^^^^^^
  File "/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py", line 1185, in main
    bad_count += parse_file(
                 ^^^^^^^^^^^
  File "/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py", line 903, in parse_file
    check_matches = extract_words_iter(line, word_regex, ignore_word_regex)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py", line 793, in extract_words_iter
    return list(word_regex.finditer(_ignore_word_sub(text, ignore_word_regex)))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt

There is no need to show KeyboardInterrupt exception stack trace.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants