Skip to content

fix: replace bare except with except Exception in gmaps/utils helpers - #606

Open
TrueFurina wants to merge 1 commit into
mxrch:masterfrom
TrueFurina:master
Open

fix: replace bare except with except Exception in gmaps/utils helpers#606
TrueFurina wants to merge 1 commit into
mxrch:masterfrom
TrueFurina:master

Conversation

@TrueFurina

Copy link
Copy Markdown

Summary

Two bare except: clauses swallow everything, including
KeyboardInterrupt/SystemExit:

  • ghunt/helpers/gmaps.py (geolocation reverse lookup retry loop) β€” intended
    to skip a failed reverse-geocode lookup
  • ghunt/helpers/utils.py (is_headers_syntax_good) β€” intended to return
    False on invalid headers

Replace both with except Exception: β€” same intended behavior, but
unexpected exceptions (e.g. NameError) now propagate instead of being
hidden.

Verification

  • python -m py_compile ghunt/helpers/gmaps.py ghunt/helpers/utils.py β†’ OK
  • grep -rn "except:" ghunt/ β†’ 0 remaining bare handlers

Files changed

  • ghunt/helpers/gmaps.py (1 line)
  • ghunt/helpers/utils.py (1 line)

@TrueFurina

Copy link
Copy Markdown
Author

Hi maintainers β€” just checking in on this PR. It fixes bare except: clauses (KeyboardInterrupt/SystemExit were being intercepted first). Happy to adjust anything to help get this merged. Thanks!

@0mran

0mran commented Aug 26, 2026 via email

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants