jenkins-bot has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/445763 )
Change subject: textlib.does_text_contain_section: Do not expect colon to be always
escaped
......................................................................
textlib.does_text_contain_section: Do not expect colon to be always escaped
Python 3.7's re.escape does not escape the :.
Bug: T199604
Change-Id: I1f8f2d0e254f421e76b97647fa93aface7ff9e72
---
M pywikibot/textlib.py
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Xqt: Looks good to me, approved
jenkins-bot: Verified
diff --git a/pywikibot/textlib.py b/pywikibot/textlib.py
index 9a83cd4..6544292 100644
--- a/pywikibot/textlib.py
+++ b/pywikibot/textlib.py
@@ -2017,7 +2017,7 @@
"""
# match preceding colon for text links
- section = re.sub(r'\\\[\\\[(\\:)?', r'\[\[\:?', re.escape(section))
+ section = re.sub(r'\\\[\\\[(\\?:)?', r'\[\[\:?', re.escape(section))
# match underscores and white spaces
section = re.sub(r'\\?[ _]', '[ _]', section)
m = re.search("=+[ ']*%s[ ']*=+" % section, pagetext)
--
To view, visit
https://gerrit.wikimedia.org/r/445763
To unsubscribe, or for help writing mail filters, visit
https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I1f8f2d0e254f421e76b97647fa93aface7ff9e72
Gerrit-Change-Number: 445763
Gerrit-PatchSet: 2
Gerrit-Owner: Dalba <dalba.wiki(a)gmail.com>
Gerrit-Reviewer: John Vandenberg <jayvdb(a)gmail.com>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: Zoranzoki21 <zorandori4444(a)gmail.com>
Gerrit-Reviewer: jenkins-bot