From ec5a0a792b2c125b28481e39d03954f089e151ad Mon Sep 17 00:00:00 2001 From: James G Sack Date: Sat, 5 Apr 2008 06:45:46 +0000 Subject: [PATCH] src/GrampsDbUtils/_GedcomLex.py : #2008 fix error in extract_date() RANGE pattern only returns 4 pattern groups, code was assigning to 5!? (see also r10470) svn: r10471 --- src/GrampsDbUtils/_GedcomLex.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/GrampsDbUtils/_GedcomLex.py b/src/GrampsDbUtils/_GedcomLex.py index ec596de89..8929e9aa2 100644 --- a/src/GrampsDbUtils/_GedcomLex.py +++ b/src/GrampsDbUtils/_GedcomLex.py @@ -269,7 +269,7 @@ def extract_date(text): # parse the range if we match, if so, return match = RANGE.match(text) if match: - (cal1, data1, ignore, cal2, data2) = match.groups() + (cal1, data1, cal2, data2) = match.groups() cal = CALENDAR_MAP.get(cal1, gen.lib.Date.CAL_GREGORIAN) @@ -309,7 +309,12 @@ def extract_date(text): dateobj = DATE_CNV.parse(text) dateobj.set_quality(qual) return dateobj + + # FIXME: explain where/why an IOError might arise + # and also: is such a long try-clause needed + # having this fallback invites "what about other exceptions?" except IOError: + # fallback strategy (evidently) return DATE_CNV.set_text(text) #-------------------------------------------------------------------------