jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/674639 )
Change subject: [IMPR] remove unicode flag in patterns ......................................................................
[IMPR] remove unicode flag in patterns
Python 3 matches are Unicode by default
Change-Id: I83fcb45b370dd53e376732a9bcc2f598dfc1ebf4 --- M scripts/maintenance/sorting_order.py M scripts/maintenance/update_linktrails.py M scripts/maintenance/wikimedia_sites.py M scripts/reflinks.py 4 files changed, 7 insertions(+), 7 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/maintenance/sorting_order.py b/scripts/maintenance/sorting_order.py index 040c318..8ab2106 100644 --- a/scripts/maintenance/sorting_order.py +++ b/scripts/maintenance/sorting_order.py @@ -1,7 +1,7 @@ #!/usr/bin/python """Script that updates interwiki sorting order in family.py file.""" # -# (C) Pywikibot team, 2020 +# (C) Pywikibot team, 2020-2021 # # Distributed under the terms of the MIT license. # @@ -60,7 +60,7 @@ family_file_name = 'pywikibot/family.py' with codecs.open(family_file_name, 'r', 'utf8') as family_file: family_text = family_file.read() - family_text = re.sub(r'(?msu)^ {4}%s.+?]' % list_name, + family_text = re.sub(r'(?ms)^ {4}%s.+?]' % list_name, text, family_text, 1) with codecs.open(family_file_name, 'w', 'utf8') as family_file: family_file.write(family_text) diff --git a/scripts/maintenance/update_linktrails.py b/scripts/maintenance/update_linktrails.py index d0b3205..4fd92bf 100644 --- a/scripts/maintenance/update_linktrails.py +++ b/scripts/maintenance/update_linktrails.py @@ -8,7 +8,7 @@ linktrails dict. """ # -# (C) Pywikibot team, 2017-2020 +# (C) Pywikibot team, 2017-2021 # # Distributed under the terms of the MIT license. # @@ -149,7 +149,7 @@ family_file_name = join('pywikibot', 'family.py') with codecs.open(family_file_name, 'r', 'utf8') as family_file: family_text = family_file.read() - family_text = re.sub(r'(?msu)^ {4}linktrails.+?}', + family_text = re.sub(r'(?ms)^ {4}linktrails.+?}', text, family_text, 1) with codecs.open(family_file_name, 'w', 'utf8') as family_file: family_file.write(family_text) diff --git a/scripts/maintenance/wikimedia_sites.py b/scripts/maintenance/wikimedia_sites.py index cb71b11..299cf69 100755 --- a/scripts/maintenance/wikimedia_sites.py +++ b/scripts/maintenance/wikimedia_sites.py @@ -7,7 +7,7 @@
""" # -# (C) Pywikibot team, 2008-2020 +# (C) Pywikibot team, 2008-2021 # # Distributed under the terms of the MIT license. # @@ -85,7 +85,7 @@ family_file_name = 'pywikibot/families/%s_family.py' % family with codecs.open(family_file_name, 'r', 'utf8') as family_file: family_text = family_file.read() - family_text = re.sub(r'(?msu)^ {4}languages_by_size.+?]', + family_text = re.sub(r'(?ms)^ {4}languages_by_size.+?]', text, family_text, 1) with codecs.open(family_file_name, 'w', 'utf8') as family_file: family_file.write(family_text) diff --git a/scripts/reflinks.py b/scripts/reflinks.py index a3a3ba6..f21b808 100755 --- a/scripts/reflinks.py +++ b/scripts/reflinks.py @@ -232,7 +232,7 @@ # remove formatting, i.e long useless strings self.title = re.sub(r'[.+-=]{4,}', ' ', self.title) # remove \n and \r and unicode spaces from titles - self.title = re.sub(r'(?u)\s', ' ', self.title) + self.title = re.sub(r'\s', ' ', self.title) self.title = re.sub(r'[\n\r\t]', ' ', self.title) # remove extra whitespaces # remove leading and trailing ./;/,/-/_/+/ /
pywikibot-commits@lists.wikimedia.org