Page MenuHomePhabricator

Wikibase support in pywikibot lacks exception handling
Open, MediumPublic

Description

Almost every save related error (in the API) that can happen in wikitext, can also happen in wikibase. However, the pywikibot interface is immature, and doesnt catch APIError and repackage them as SaveRelatedErrors. Probably because the traditional exceptions dont happen as frequently on Wikidata, and the Wikidata community care about quantity over quality at the moment. Also the repo software isnt as mature as the core mediawiki, so it may not yet raise errors when it should.

e.g. SpamfilterError happens when a page is on the Spam-blacklist, which has only three entries.

https://www.wikidata.org/wiki/MediaWiki:Spam-blacklist :

\bgroups\.diigo\.com\b
\btefnut\.grainger\.uiuc\.edu/site/wishlist\b
\bcalabasassmiles\.com\b

LockedPage .. also only three items which can cause this problem

https://www.wikidata.org/w/index.php?title=Special%3AProtectedPages&namespace=0&type=edit&level=sysop
Q5268366, Q16503, Q293130

EditConflict ... here is where wikibase shines - it typically splices together changes from multiple users happening at the same time. But I've found the algorithm merges conflicting changes when it should reject them, so the repo might need to send this exception more frequently.