Framawiki created this task.
Framawiki added a project: Pywikibot.
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper.

TASK DESCRIPTION
  For some reason OtherPageSaveError is raised where I was excepting 
SpamfilterError.
  
    >>> import pywikibot as pw;pw.Page(pw.Site(), 
'user:framawiki/Brouillon3').put('https://bit.ly/test')
    WARNING: No user is logged in on site wikipedia:fr
    WARNING: No user is logged in on site wikipedia:fr
    Logging in to wikipedia:fr as Framawiki
    WARNING: API error spamblacklist: The text you wanted to save was blocked 
by the spam filter. This is probably caused by a link to a blacklisted external 
site. The following text is what triggered our spam filter: bit.ly/test
    Traceback (most recent call last):
      File "pywikibot/page/__init__.py", line 117, in handle
        func(self, *args, **kwargs)
      File "pywikibot/page/__init__.py", line 1316, in _save
        watch=watch, bot=botflag, **kwargs)
      File "pywikibot/site/__init__.py", line 1340, in callee
        return fn(self, *args, **kwargs)
      File "pywikibot/site/__init__.py", line 5383, in editpage
        result = req.submit()
      File "pywikibot/data/api.py", line 2092, in submit
        raise APIError(**result['error'])
    pywikibot.data.api.APIError: spamblacklist: The text you wanted to save was 
blocked by the spam filter. This is probably caused by a link to a blacklisted 
external site. The following text is what triggered our spam filter: bit.ly/test
    [spamblacklist: {'matches': ['bit.ly/test']};
     help: See https://fr.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 "<console>", line 1, in <module>
      File "pywikibot/tools/__init__.py", line 1790, in wrapper
        return obj(*__args, **__kw)
      File "pywikibot/tools/__init__.py", line 1790, in wrapper
        return obj(*__args, **__kw)
      File "pywikibot/page/__init__.py", line 1383, in put
        **kwargs)
      File "pywikibot/tools/__init__.py", line 1790, in wrapper
        return obj(*__args, **__kw)
      File "pywikibot/tools/__init__.py", line 1790, in wrapper
        return obj(*__args, **__kw)
      File "pywikibot/page/__init__.py", line 1305, in save
        cc=apply_cosmetic_changes, quiet=quiet, **kwargs)
      File "pywikibot/page/__init__.py", line 138, in wrapper
        handle(func, self, *args, **kwargs)
      File "pywikibot/page/__init__.py", line 130, in handle
        raise pywikibot.OtherPageSaveError(self, err)
    pywikibot.exceptions.OtherPageSaveError: Edit to page 
[[Utilisateur:Framawiki/Brouillon3]] failed:
    spamblacklist: The text you wanted to save was blocked by the spam filter. 
This is probably caused by a link to a blacklisted external site. The following 
text is what triggered our spam filter: bit.ly/test
    [spamblacklist: {'matches': ['bit.ly/test']};
     help: See https://fr.wikipedia.org/w/api.php for API usage. Subscribe to 
the mediawiki-api-announce mailing list at 
&lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&gt; for 
notice of API deprecations and breaking changes.]

TASK DETAIL
  https://phabricator.wikimedia.org/T249436

EMAIL PREFERENCES
  https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Framawiki
Cc: Aklapper, pywikibot-bugs-list, Framawiki, Zkhalido, Viztor, Wenyi, Tbscho, 
MayS, Mdupont, JJMC89, Dvorapa, Altostratus, Avicennasis, mys_721tx, jayvdb, 
Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to