# HG changeset patch # User Mads Kiilerich # Date 1585405705 -3600 # Node ID 68bbfd164b231bed3dd3fcbfca65d54936d54c94 # Parent 96b43734025f4598df8d07860946f4ad16da5f27 scripts: in regexps, use + when we actually want to make long matches instead of empty Greedyness seems to have changed with Python 3 and it is less forgiving and would happily make empty matches everywhere. diff -r 96b43734025f -r 68bbfd164b23 scripts/update-copyrights.py --- a/scripts/update-copyrights.py Sat Mar 28 22:41:12 2020 +0100 +++ b/scripts/update-copyrights.py Sat Mar 28 15:28:25 2020 +0100 @@ -134,7 +134,7 @@ all_entries=repo_entries + contributor_data.other_about + contributor_data.other, no_entries=contributor_data.no_about, domain_extra=contributor_data.domain_extra, - split_re=r'(?:
  • Copyright © [^\n]*
  • \n)*', + split_re=r'(?:
  • Copyright © [^\n]+
  • \n)+', normalize_name=lambda name: name.split('<', 1)[0].strip(), format_f=lambda years, name: '
  • Copyright © %s, %s
  • \n' % (nice_years(years, '–', ', '), name), ) @@ -144,7 +144,7 @@ all_entries=repo_entries + contributor_data.other_contributors + contributor_data.other, no_entries=contributor_data.total_ignore, domain_extra=contributor_data.domain_extra, - split_re=r'(?: [^\n]*\n)*', + split_re=r'(?: [^\n]+\n)+', normalize_name=lambda name: name, format_f=lambda years, name: (' %s%s%s\n' % (name, ' ' if years else '', nice_years(years))), ) @@ -154,7 +154,7 @@ all_entries=repo_entries, no_entries=contributor_data.total_ignore, domain_extra={}, - split_re=r'(?<=©) .* (?=by various authors)', + split_re=r'(?<=©) .+ (?=by various authors)', normalize_name=lambda name: '', format_f=lambda years, name: ' ' + nice_years(years, '–', ', ') + ' ', ) @@ -165,7 +165,7 @@ all_entries=repo_entries, no_entries=contributor_data.total_ignore, domain_extra={}, - split_re=r"(?<=copyright = u').*(?= by various authors)", + split_re=r"(?<=copyright = ').+(?= by various authors)", normalize_name=lambda name: '', format_f=lambda years, name: nice_years(years, '-', ', '), )