# dateparser==0.7.0 ( also reproduces on master branch )
import dateparser
import datetime
import pytz
settings = { "RELATIVE_BASE": datetime.datetime.now().replace(tzinfo=pytz.timezone("Europe/Paris")) }
for input_ in ( "2009-06-01T10:00:00+09:00", "yesterday", "July 5th"):
print (input_, dateparser.parse(input_), dateparser.parse(input_, settings=settings))
"2009-06-01T10:00:00+09:00" or "yesterday" work as expected, but "July 5th" cause a TypeError: can't compare offset-naive and offset-aware datetimes, that is raised here
With this snippet:
"2009-06-01T10:00:00+09:00"
or"yesterday"
work as expected, but"July 5th"
cause aTypeError: can't compare offset-naive and offset-aware datetimes
, that is raised here