Page MenuHomePhabricator

KeyError: 'warning' in editpage during abusefilter exception
Closed, ResolvedPublic

Description

Do you want to accept these changes? ([y]es, [N]o, [e]dit original, edit
[l]atest, open in [b]rowser, [m]ore context, [a]ll, [q]uit): y
Edit summary: Bot: Entferne Vorlage: Navigationsleiste Kader des VfB Lübeck
Waiting for 2 pages to be put. Estimated time remaining: 0:00:10
Page [[Mirko Boland]] saved
Sleeping for 4.1 seconds, 2021-06-22 16:25:15
WARNING: API error abusefilter-disallowed: This action has been automatically identified as harmful, and therefore disallowed. If you believe your action was constructive, please inform an administrator of what you were trying to do. A brief description of the abuse rule which your action matched is: Bitte nicht so schnell
Exception in thread Put-Thread:
Traceback (most recent call last):
  File "C:\pwb\GIT\core\pywikibot\site\_apisite.py", line 1630, in editpage
    result = req.submit()
  File "C:\pwb\GIT\core\pywikibot\data\api.py", line 1868, in submit
    raise pywikibot.exceptions.APIError(**result['error'])
pywikibot.exceptions.APIError: abusefilter-disallowed: This action has been automatically identified as harmful, and therefore disallowed. If you believe your action was constructive, please inform an administrator of what you were trying to do. A brief description of the abuse rule which your action matched is: Bitte nicht so schnell
[abusefilter: {'id': '242', 'description': 'Bitte nicht so schnell', 'actions': ['disallow']};
 help: See https://de.wikipedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at <https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce> for notice of API deprecations and breaking changes.]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Python39\lib\threading.py", line 950, in _bootstrap_inner
    self.run()
  File "C:\Python39\lib\threading.py", line 888, in run
    self._target(*self._args, **self._kwargs)
  File "C:\pwb\GIT\core\pywikibot\__init__.py", line 1333, in async_manager
    request(*args, **kwargs)
  File "C:\pwb\GIT\core\pywikibot\page\_decorators.py", line 33, in handle
    func(self, *args, **kwargs)
  File "C:\pwb\GIT\core\pywikibot\page\__init__.py", line 1212, in _save
    done = self.site.editpage(self, summary=summary, minor=minor,
  File "C:\pwb\GIT\core\pywikibot\site\_decorators.py", line 92, in callee
    return fn(self, *args, **kwargs)
  File "C:\pwb\GIT\core\pywikibot\site\_apisite.py", line 1658, in editpage
    'warning': err.other['warning'],
KeyError: 'warning'

6 pages read
4 pages written
0 pages skipped
Execution time: 21 seconds
Read operation time: 2.5 seconds
Write operation time: 5.2 seconds
Script terminated successfully.
Waiting for 1 pages to be put. Estimated time remaining: 0:00:05

Event Timeline

Xqt triaged this task as High priority.Jun 22 2021, 2:36 PM

Change 701657 had a related patch set uploaded (by JJMC89; author: JJMC89):

[pywikibot/core@master] [fix] Update handling of abusefilter-{disallow,warning} codes

https://gerrit.wikimedia.org/r/701657

Change 701657 merged by jenkins-bot:

[pywikibot/core@master] [fix] Update handling of abusefilter-{disallow,warning} codes

https://gerrit.wikimedia.org/r/701657