parsedatetime
parsedatetime copied to clipboard
AttributeError: 'NoneType' object has no attribute 'group'
de_DE = parsedatetime.Constants(localeID="de_DE")
cal = parsedatetime.Calendar(constants=de_DE)
time_struct = cal.parseDateText("2013")
results in
AttributeError: 'NoneType' object has no attribute 'group'
It will work, if a month is found. A more appropriate error message or an own Exception class would be great. I catch this error so I try to extract the year by custom code.