From 127cfa3a8133fd39723ebe27e58aac0a74c29eb8 Mon Sep 17 00:00:00 2001 From: Tim G L Lyons Date: Sun, 19 Feb 2012 16:18:26 +0000 Subject: [PATCH] 0005202: Failed gedcom file import. Dates too far in the future give OverflowError, allow for this exception. svn: r18932 --- src/plugins/lib/libgedcom.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/lib/libgedcom.py b/src/plugins/lib/libgedcom.py index 8498aef4f..1204a963b 100644 --- a/src/plugins/lib/libgedcom.py +++ b/src/plugins/lib/libgedcom.py @@ -6736,8 +6736,13 @@ class GedcomParser(UpdateCallback): tstruct = time.strptime(dstr, "%d %m %Y") val = time.mktime(tstruct) obj.change = val - except ValueError: - # parse of time structure failed, so ignore + except (ValueError, OverflowError): + # parse of time structure failed, so ignore. According to the + # Python manual: "The functions in this [time] module do not + # handle dates and times before the epoch or far in the future. + # The cut-off point in the future is determined by the C + # library; for Unix, it is typically in 2038." If the time is + # too far in the future, this gives OverflowError. pass def build_media_object(self, obj, form, filename, title, note):