Page MenuHomePhabricator

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

Description

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/pwb.py", line 246, in <module>
    if not main():
  File "/data/project/heritage/pywikibot/pwb.py", line 240, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "/data/project/heritage/pywikibot/pwb.py", line 87, in run_python_file
    main_mod.__dict__)
  File "unused_monument_images.py", line 243, in <module>
    main()
  File "unused_monument_images.py", line 238, in main
    countrycode, lang, countryconfig, conn, cursor, conn2, cursor2)
  File "unused_monument_images.py", line 124, in processCountry
    page.put(text, comment)
  File "/data/project/heritage/pywikibot/pywikibot/tools/__init__.py", line 1105, in wrapper
    return obj(*__args, **__kw)
  File "/data/project/heritage/pywikibot/pywikibot/page.py", line 1145, in put
    **kwargs)
  File "/data/project/heritage/pywikibot/pywikibot/tools/__init__.py", line 1105, in wrapper
    return obj(*__args, **__kw)
  File "/data/project/heritage/pywikibot/pywikibot/page.py", line 1063, in save
    cc=apply_cosmetic_changes, **kwargs)
  File "/data/project/heritage/pywikibot/pywikibot/page.py", 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 unused_monument_images.py
diff --git a/erfgoedbot/unused_monument_images.py b/erfgoedbot/unused_monument_images.py
index f7c4076..c685864 100644
--- a/erfgoedbot/unused_monument_images.py
+++ b/erfgoedbot/unused_monument_images.py
@@ -116,7 +116,7 @@ def processCountry(countrycode, lang, countryconfig, conn, cursor, conn2, cursor
     else:
         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 https://commons.wikimedia.org/wiki/Commons:Monuments_database/Unused_images/Statistics 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

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

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

Reason:
Already merged in I4f1ba0b7e2fe5d8b3cd133e37bfcb63d228acdcf

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

JeanFred claimed this task.

Closing as resolved.