From c951dbd64096d3df7acb67b1a4bcfb8eb0c0fcf7 Mon Sep 17 00:00:00 2001 From: Kotesh Kumar Yelamati Date: Mon, 13 Jul 2026 15:11:56 -0400 Subject: [PATCH 1/3] Fix bare except clauses in pattern/web/__init__.py Specify exception types in import error handling. --- pattern/web/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pattern/web/__init__.py b/pattern/web/__init__.py index c76cea88..df29ad71 100644 --- a/pattern/web/__init__.py +++ b/pattern/web/__init__.py @@ -95,19 +95,19 @@ # If this module is used separately, # a dict is used (i.e. this Python session only). from .cache import Cache, cache, TMP -except: +except ImportError: cache = {} try: from .imap import Mail, MailFolder, Message, GMAIL from .imap import MailError, MailServiceError, MailLoginError, MailNotLoggedIn from .imap import FROM, SUBJECT, DATE, BODY, ATTACHMENTS -except: +except ImportError: pass try: MODULE = os.path.dirname(os.path.realpath(__file__)) -except: +except Exception: MODULE = "" #### UNICODE ####################################################################################### From 3b8fb38236ac25d8cc79b4f8efda7cac9c940920 Mon Sep 17 00:00:00 2001 From: Kotesh Kumar Yelamati Date: Mon, 13 Jul 2026 15:12:31 -0400 Subject: [PATCH 2/3] Fix bare except in pattern/text/en/__init__.py --- pattern/text/en/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pattern/text/en/__init__.py b/pattern/text/en/__init__.py index 31d548f7..abece17d 100644 --- a/pattern/text/en/__init__.py +++ b/pattern/text/en/__init__.py @@ -20,7 +20,7 @@ try: MODULE = os.path.dirname(os.path.realpath(__file__)) -except: +except Exception: MODULE = "" sys.path.insert(0, os.path.join(MODULE, "..", "..", "..", "..")) From 8034149ae2984c85b4612ea02a6d0fe43ceb01fc Mon Sep 17 00:00:00 2001 From: Kotesh Kumar Yelamati Date: Mon, 13 Jul 2026 15:13:08 -0400 Subject: [PATCH 3/3] Fix bare except in pattern/text/de/__init__.py --- pattern/text/de/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pattern/text/de/__init__.py b/pattern/text/de/__init__.py index 4d4f073b..f1240412 100644 --- a/pattern/text/de/__init__.py +++ b/pattern/text/de/__init__.py @@ -20,7 +20,7 @@ try: MODULE = os.path.dirname(os.path.realpath(__file__)) -except: +except Exception: MODULE = "" sys.path.insert(0, os.path.join(MODULE, "..", "..", "..", ".."))