From 974ac5c731f77433b83429df8e0a0b113d696989 Mon Sep 17 00:00:00 2001 From: Rami Abdelrazzaq Date: Sat, 12 Sep 2026 21:03:01 -0500 Subject: [PATCH] Handle date parser overflow errors --- sqlite_utils/recipes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sqlite_utils/recipes.py b/sqlite_utils/recipes.py index d28a099..ba05720 100644 --- a/sqlite_utils/recipes.py +++ b/sqlite_utils/recipes.py @@ -31,7 +31,7 @@ def parsedate( .date() .isoformat() ) - except parser.ParserError: + except (parser.ParserError, OverflowError): if errors is IGNORE: return value elif errors is SET_NULL: @@ -58,7 +58,7 @@ def parsedatetime( return value try: return parser.parse(value, dayfirst=dayfirst, yearfirst=yearfirst).isoformat() - except parser.ParserError: + except (parser.ParserError, OverflowError): if errors is IGNORE: return value elif errors is SET_NULL: