Page MenuHomePhabricator

Don't add interwiki's on unused images pages to unbreak bot
Closed, ResolvedPublic


If we have an unused images page the bot adds an old style [[:<other language>:<other page>]] interwiki link. These days the pages are linked using Wikidata so this is no longer needed.

Some fun people at the Dutch Wikipedia decided to enforce no interwiki with an abusefilter rule so now the bot is completely broken. Great

ERROR: editpage: abusefilter-warning-interwiki
Hit AbuseFilter: Toevoegen interwikilink,
WARNING: Page [[Wikipedia:Wikiproject/Erfgoed/Belgische Erfgoed Inventarisatie/Vlaanderen/Ongebruikte foto's]] not saved
Traceback (most recent call last):
  File "/data/project/heritage/pywikibot/", line 246, in <module>
    if not main():
  File "/data/project/heritage/pywikibot/", line 240, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "/data/project/heritage/pywikibot/", line 87, in run_python_file
  File "", line 243, in <module>
  File "", line 238, in main
    countrycode, lang, countryconfig, conn, cursor, conn2, cursor2)
  File "", line 124, in processCountry
    page.put(text, comment)
  File "/data/project/heritage/pywikibot/pywikibot/tools/", line 1105, in wrapper
    return obj(*__args, **__kw)
  File "/data/project/heritage/pywikibot/pywikibot/", line 1145, in put
  File "/data/project/heritage/pywikibot/pywikibot/tools/", line 1105, in wrapper
    return obj(*__args, **__kw)
  File "/data/project/heritage/pywikibot/pywikibot/", line 1063, in save
    cc=apply_cosmetic_changes, **kwargs)
  File "/data/project/heritage/pywikibot/pywikibot/", line 1087, in _save
    raise err
pywikibot.exceptions.PageSaveRelatedError: Page [[nl:Wikipedia:Wikiproject/Erfgoed/Belgische Erfgoed Inventarisatie/Vlaanderen/Ongebruikte foto's]] was not saved.
<class 'pywikibot.exceptions.PageSaveRelatedError'>

Event Timeline

Multichill raised the priority of this task from to High.
Multichill updated the task description. (Show Details)
Multichill moved this task to Backlog on the Wiki-Loves-Monuments-Database board.
Multichill added a subscriber: Multichill.
Multichill added a subscriber: JeanFred.

Just made a local change to see if it works:

tools.heritage@tools-bastion-01:~/erfgoedbot$ git diff
diff --git a/erfgoedbot/ b/erfgoedbot/
index f7c4076..c685864 100644
--- a/erfgoedbot/
+++ b/erfgoedbot/
@@ -116,7 +116,7 @@ def processCountry(countrycode, lang, countryconfig, conn, cursor, conn2, cursor
         comment = u'Images to be used in monument lists: %s' % totalImages

-    text = text + getInterwikisUnusedImages(countrycode, lang)
+    #text = text + getInterwikisUnusedImages(countrycode, lang)

     site = pywikibot.Site(lang, u'wikipedia')
     page = pywikibot.Page(site, unusedImagesPage)

Answer is yes. The bot completed and was updated. Someone needs to do the git/gerrit stuff and remove the function.

Change 235244 had a related patch set uploaded (by Jean-Frédéric):
Do not add interwiki's on unused images pages to unbreak bot

Change 235244 abandoned by Jean-Frédéric:
Do not add interwiki's on unused images pages to unbreak bot

Already merged in I4f1ba0b7e2fe5d8b3cd133e37bfcb63d228acdcf

JeanFred claimed this task.

Closing as resolved.