parsedatetime icon indicating copy to clipboard operation
parsedatetime copied to clipboard

AttributeError: 'NoneType' object has no attribute 'group'

Open mjrk opened this issue 9 years ago • 0 comments

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.

mjrk avatar Oct 15 '15 12:10 mjrk