Skip to content

fix: replace bare except with except Exception - #611

Closed
TrueFurina wants to merge 1 commit into
psf:masterfrom
TrueFurina:master
Closed

TrueFurina wants to merge 1 commit into
psf:masterfrom
TrueFurina:master

Conversation

@TrueFurina

Copy link
Copy Markdown

Summary

requests_html.py __convert() (used for cookie conversion) has a bare
except: that swallows everything, including KeyboardInterrupt/SystemExit,
and hides programming errors as if they were expected eval failures.

Replace with except Exception: — same intended behavior (return an empty
kv on eval failure), but unexpected exceptions now propagate.

Verification

  • python -m py_compile requests_html.py → OK
  • grep -c "except:" requests_html.py → 0 remaining bare handlers

Files changed

  • requests_html.py (1 line)

@TrueFurina

Copy link
Copy Markdown
Author

Closing due to inactivity - happy to revive if there is still interest. Thanks!

@TrueFurina TrueFurina closed this Sep 16, 2026
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