mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-10-23 17:57:03 +02:00
Handle date parser overflow errors
This commit is contained in:
parent
85b1be10c8
commit
974ac5c731
1 changed files with 2 additions and 2 deletions
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue