Open lopuhin opened 6 years ago
It's because of this code in dateparser.parse()
. If settings
is not passed, the default parser is used whether languages
is []
, None
or other false value, but if settings
is passed, languages=[]
is used. And dateparser.languages.loader.LocaleDataLoader._load_data()
handles []
and None
differently.
So it depends on the intended meaning of languages=[]
. If it indeed should mean that no languages is supported then the default parser should not be used when languages=[]
is passed. Otherwise LocaleDataLoader
should be fixed to check for emptiness an not just for None
.
So only the last call works correctly, while passing empty or unrelated settings makes it fail. Also it seems that the issue is with
languages=[]
, passinglanguages=None
works the same in all cases.