Fix Feb 29 issue #1733
This commit is contained in:
parent
f908bc364e
commit
db9637ce4f
|
@ -344,10 +344,16 @@ def scan_mail_log_line(line, collector):
|
||||||
|
|
||||||
# Replaced the dateutil parser for a less clever way of parser that is roughly 4 times faster.
|
# Replaced the dateutil parser for a less clever way of parser that is roughly 4 times faster.
|
||||||
# date = dateutil.parser.parse(date)
|
# date = dateutil.parser.parse(date)
|
||||||
date = datetime.datetime.strptime(date, '%b %d %H:%M:%S')
|
|
||||||
date = date.replace(START_DATE.year)
|
# date = datetime.datetime.strptime(date, '%b %d %H:%M:%S')
|
||||||
|
# date = date.replace(START_DATE.year)
|
||||||
|
|
||||||
|
# strptime fails on Feb 29 if correct year is not provided. See https://bugs.python.org/issue26460
|
||||||
|
date = datetime.datetime.strptime(str(START_DATE.year) + ' ' + date, '%Y %b %d %H:%M:%S')
|
||||||
|
# print("date:", date)
|
||||||
|
|
||||||
# Check if the found date is within the time span we are scanning
|
# Check if the found date is within the time span we are scanning
|
||||||
|
# END_DATE < START_DATE
|
||||||
if date > START_DATE:
|
if date > START_DATE:
|
||||||
# Don't process, and halt
|
# Don't process, and halt
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue