jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/595278 )
Change subject: [cleanup] Remove desupported SkipPageError exception handling ......................................................................
[cleanup] Remove desupported SkipPageError exception handling
Change-Id: I4f94b197271711390abde9f12ccc1b0369762aee --- M ROADMAP.rst M pywikibot/bot.py 2 files changed, 2 insertions(+), 32 deletions(-)
Approvals: JJMC89: Looks good to me, approved Huji: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/ROADMAP.rst b/ROADMAP.rst index ea8d2b0..ba37671 100644 --- a/ROADMAP.rst +++ b/ROADMAP.rst @@ -1,6 +1,7 @@ Current release ~~~~~~~~~~~~~~~
+* Usage of SkipPageError with BaseBot has been removed * pagegenerators: handle protocols in -weblink (T251308, T251310) * Bugfixes and improvements
@@ -9,7 +10,6 @@
* 3.0.20200508: Page.getVersionHistory and Page.fullVersionHistory() methods will be removed (T136513, T151110) * 3.0.20200405: Site and Page methods deprecated for 10 years or longer will be removed -* 3.0.20200405: Usage of SkipPageError with BaseBot will be removed * 3.0.20200326: Functions dealing with stars list will be removed * 3.0.20200306: Support of MediaWiki releases below 1.19 will be dropped (T245350) * 3.0.20200306: tools.ip will be dropped in favour of tools.is_IP (T243171) diff --git a/pywikibot/bot.py b/pywikibot/bot.py index 4d1cfcc..93a9376 100644 --- a/pywikibot/bot.py +++ b/pywikibot/bot.py @@ -215,21 +215,6 @@ """
-# It's not possible to use pywikibot.exceptions.PageRelatedError as that is -# importing pywikibot.data.api which then needs pywikibot.bot -class SkipPageError(Exception): - - """Skipped page in run.""" - - message = 'Page "{0}" skipped due to {1}.' - - def __init__(self, page, reason): - """Initializer.""" - super(SkipPageError, self).__init__(self.message.format(page, reason)) - self.reason = reason - self.page = page - - class UnhandledAnswer(Exception):
"""The given answer didn't suffice.""" @@ -1398,22 +1383,7 @@ try: for item in self.generator: # preprocessing of the page - try: - initialized_page = self.init_page(item) - except SkipPageError as e: - issue_deprecation_warning('Use of SkipPageError', - 'BaseBot.skip_page() method', - warning_class=FutureWarning, - since='20180522') - pywikibot.warning('Skipped "{0}" due to: {1}'.format( - item, e.reason)) - if PY2: - # Python 2 does not clear the exception and it may seem - # that the generator stopped due to an exception - sys.exc_clear() - self._skip_counter += 1 - continue - + initialized_page = self.init_page(item) if initialized_page is None: issue_deprecation_warning( 'Returning None from init_page() method',
pywikibot-commits@lists.wikimedia.org