From 474c6daef0d2c0fb175d3cd4d59d3397fc33d0ae Mon Sep 17 00:00:00 2001 From: haosenwang1018 <167664334+haosenwang1018@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:23:53 +0000 Subject: [PATCH] fix: replace 4 bare except clauses with except Exception --- httpbin/core.py | 4 ++-- httpbin/helpers.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/httpbin/core.py b/httpbin/core.py index 305c9882..96fb8019 100644 --- a/httpbin/core.py +++ b/httpbin/core.py @@ -178,7 +178,7 @@ def jsonify(*args, **kwargs): ignore_classes=["werkzeug.exceptions.NotFound"], ) bugsnag.flask.handle_exceptions(app) - except: + except Exception: app.logger.warning("Unable to initialize Bugsnag exception handling.") # ----------- @@ -1307,7 +1307,7 @@ def decode_base64(value): encoded = value.encode("utf-8") # base64 expects binary string as input try: return base64.urlsafe_b64decode(encoded).decode("utf-8") - except: + except Exception: return "Incorrect Base64 data try: SFRUUEJJTiBpcyBhd2Vzb21l" diff --git a/httpbin/helpers.py b/httpbin/helpers.py index b29e1835..e322f863 100644 --- a/httpbin/helpers.py +++ b/httpbin/helpers.py @@ -402,12 +402,12 @@ def __parse_request_range(range_header_text): try: right = int(components[1]) - except: + except Exception: pass try: left = int(components[0]) - except: + except Exception: pass return left, right