# HG changeset patch # User Henry S. Thompson # Date 1543585490 0 # Node ID 3313edbab3b02a358be3967d8dcfe5e6b818bb79 # Parent 4cf6bc21f68358b4a8eb6f1c39166551a40f9260 simpler fix for d-o-m default diff -r 4cf6bc21f683 -r 3313edbab3b0 master/bin/fixDates.py --- a/master/bin/fixDates.py Fri Nov 30 13:43:36 2018 +0000 +++ b/master/bin/fixDates.py Fri Nov 30 13:44:50 2018 +0000 @@ -41,9 +41,10 @@ except: # Unusual month or year field try: - # day 1 is because w/o it the default is today's is used, which may + # settings is because w/o it the default is today's is used, which may # fail if it's e.g. 31 March today and the string is "April 2017" - d=parse("1 %s %s"%(ff.group(2),ff.group(3)))#,languages=['en']) + d=parse("%s %s"%(ff.group(2),ff.group(3)), + settings={'PREFER_DAY_OF_MONTH': 'first'}) if d is None or count is None: print(5,ff.group(1),ff.group(2),ff.group(3),ff.group(4), file=sys.stderr) @@ -87,7 +88,8 @@ else: l=' '.join(cols) try: - d=parse(l)#,languages=['en'])) + d=parse(l, + settings={'PREFER_DAY_OF_MONTH': 'first'}) if d is None: print(3,sn[scheme],l,count,file=sys.stderr) bogons+=1