Skip to content

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

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

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

Conversation

@koteshyelamati

Copy link
Copy Markdown
Contributor

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.

@harryjackson

Copy link
Copy Markdown
Collaborator

Thank you. Your two commits are merged in #766, with the /base64 conflict resolved. Closing.

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