Skip to content

Fix bare except clauses in httpbin/core.py and httpbin/helpers.py#744

Open
koteshyelamati wants to merge 2 commits into
postmanlabs:masterfrom
koteshyelamati:master
Open

Fix bare except clauses in httpbin/core.py and httpbin/helpers.py#744
koteshyelamati wants to merge 2 commits into
postmanlabs:masterfrom
koteshyelamati:master

Conversation

@koteshyelamati

Copy link
Copy Markdown

Replace 4 bare except: clauses with specific exception types across two files.

httpbin/core.py (2 fixes → except Exception:):

  • Bugsnag initialization fallback
  • Base64 URL-safe decode error handler

httpbin/helpers.py (2 fixes → except (ValueError, IndexError):):

  • Two int() parse attempts in the byte-range header parser

Bare except: catches BaseException including SystemExit and KeyboardInterrupt, which is almost never intended. Specific exception types make the error handling explicit and safe.

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