From: Dave Holland Date: Wed, 1 Jun 2011 19:58:27 +0200 Subject: Normalise year info to be within Python's year bounds. Closes: #574133 --- vobject/icalendar.py | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/vobject/icalendar.py b/vobject/icalendar.py index b960deb..79ea7af 100644 --- a/vobject/icalendar.py +++ b/vobject/icalendar.py @@ -1617,6 +1617,11 @@ def stringToDateTime(s, tzinfo=None): tzinfo = utc except: raise ParseError("'%s' is not a valid DATE-TIME" % s) + if year < datetime.MINYEAR: + year = datetime.MINYEAR + if year > datetime.MAXYEAR: + year = datetime.MAXYEAR + return datetime.datetime(year, month, day, hour, minute, second, 0, tzinfo) --