| matej_suchanek created this task. matej_suchanek added a project: Pywikibot-textlib.py. Herald added subscribers: pywikibot-bugs-list, Aklapper. |
TASK DESCRIPTION
Run this code:
import pywikibot import re
from pywikibot import pagegenerators from pywikibot import textlib site = pywikibot.Site() pattern = textlib.FILE_LINK_REGEX % '|'.join(site.namespaces[6]) regex = re.compile(pattern, re.VERBOSE) pywikibot.output(regex.pattern) def my_replace(match): pywikibot.output(match) for page in pagegenerators.RandomPageGenerator(total=100, site=site, namespaces=[0]): page.get() pywikibot.output(page.title()) regex.sub(my_replace, page.text)
When you bump into an article with a file having a wikilink inside its caption (like [[File:ABC.jpg|123px|text [[Lorem ipsum]] text]]), the bot stops printing and just gets stuck.
TASK DETAIL
EMAIL PREFERENCES
To: matej_suchanek
Cc: Aklapper, matej_suchanek, pywikibot-bugs-list
Cc: Aklapper, matej_suchanek, pywikibot-bugs-list
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
