prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Codespell don't handle KeyboardInterrupt exception
  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.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `codespell_lib/__main__.py`
  Content:
  ```
  1 import sys
  2 
  3 from ._codespell import _script_main
  4 
  5 if __name__ == "__main__":
  6     sys.exit(_script_main())
  7
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/codespell_lib/__main__.py b/codespell_lib/__main__.py
  --- a/codespell_lib/__main__.py
  +++ b/codespell_lib/__main__.py
  @@ -3,4 +3,7 @@
   from ._codespell import _script_main
   
   if __name__ == "__main__":
  -    sys.exit(_script_main())
  +    try:
  +        sys.exit(_script_main())
  +    except KeyboardInterrupt:
  +        pass
  
verification_info: {"golden_diff": "diff --git a/codespell_lib/__main__.py b/codespell_lib/__main__.py\n--- a/codespell_lib/__main__.py\n+++ b/codespell_lib/__main__.py\n@@ -3,4 +3,7 @@\n from ._codespell import _script_main\n \n if __name__ == \"__main__\":\n-    sys.exit(_script_main())\n+    try:\n+        sys.exit(_script_main())\n+    except KeyboardInterrupt:\n+        pass\n", "issue": "Codespell don't handle KeyboardInterrupt exception\nThis should be catched and the program should stop gracefully but instead show default stack trace:\r\n\r\n```\r\n^CTraceback (most recent call last):\r\n  File \"/home/kuba/.local/bin/codespell\", line 8, in <module>\r\n    sys.exit(_script_main())\r\n             ^^^^^^^^^^^^^^\r\n  File \"/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py\", line 1017, in _script_main\r\n    return main(*sys.argv[1:])\r\n           ^^^^^^^^^^^^^^^^^^^\r\n  File \"/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py\", line 1185, in main\r\n    bad_count += parse_file(\r\n                 ^^^^^^^^^^^\r\n  File \"/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py\", line 903, in parse_file\r\n    check_matches = extract_words_iter(line, word_regex, ignore_word_regex)\r\n                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\n  File \"/home/kuba/.local/lib/python3.12/site-packages/codespell_lib/_codespell.py\", line 793, in extract_words_iter\r\n    return list(word_regex.finditer(_ignore_word_sub(text, ignore_word_regex)))\r\n           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\r\nKeyboardInterrupt\r\n```\r\n\r\nThere is no need to show `KeyboardInterrupt` exception stack trace.\n", "before_files": [{"content": "import sys\n\nfrom ._codespell import _script_main\n\nif __name__ == \"__main__\":\n    sys.exit(_script_main())\n", "path": "codespell_lib/__main__.py"}], "after_files": [{"content": "import sys\n\nfrom ._codespell import _script_main\n\nif __name__ == \"__main__\":\n    try:\n        sys.exit(_script_main())\n    except KeyboardInterrupt:\n        pass\n", "path": "codespell_lib/__main__.py"}]}