Skip to content

fix: replace bare except with except Exception (4 modules) - #200

Open
TrueFurina wants to merge 1 commit into
antoniaci:mainfrom
TrueFurina:main
Open

TrueFurina wants to merge 1 commit into
antoniaci:mainfrom
TrueFurina:main

Conversation

@TrueFurina

Copy link
Copy Markdown

Summary

Four bare except: clauses catch everything, including
KeyboardInterrupt/SystemExit, and hide programming errors as if they were
expected failures:

  • src/modules/export/pdf.py (PDF drawing loop) — skip on draw error
  • src/modules/utils/file_operations.py — return False when a file cannot be
    read
  • src/modules/utils/http_client.py — fall back to binary decode when
    response.text() fails
  • src/modules/utils/parse.py (2 places: JSON-path access + regex match) —
    return False on miss

Replace all with except Exception: — intended behavior unchanged, but
unexpected exceptions now propagate.

Verification

  • python -m py_compile <the 4 files> → OK
  • grep -rn "except:" src/ → 0 remaining bare handlers

Files changed

  • src/modules/export/pdf.py
  • src/modules/utils/file_operations.py
  • src/modules/utils/http_client.py
  • src/modules/utils/parse.py (2 lines)

@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!

This branch has not been deployed

No deployments
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.

1 participant