Meno25 created this task. Meno25 added projects: Pywikibot, Pywikibot-redirect.py. Restricted Application added subscribers: pywikibot-bugs-list, alanajjar, Aklapper.
TASK DESCRIPTION **Background information:** - On Wikimedia wikis, sometimes extra namespaces are deleted without properly deleting/moving the pages in those namespace which leads to the pages being inaccessible to users. - The technical details of this issue are described in T109238: Clean up broken namespace pages across Wikimedia sites <https://phabricator.wikimedia.org/T109238> - The list of affected pages on Wikimedia wikis is available as P1884 <https://phabricator.wikimedia.org/P1884> - Take Arabic Wikiversity (arwikiversity) as an example. From the above paste, the list of affected pages is: arwikiversity: id=2394 ns=0 dbk=Topic:علم_المواد -> Topic:علم_المواد (no conflict) DRY RUN ONLY arwikiversity: id=1958 ns=0 dbk=Topic:ميكانيكا_تطبيقية -> Topic:ميكانيكا_تطبيقية (no conflict) DRY RUN ONLY arwikiversity: id=2393 ns=0 dbk=Topic:ميكانيكا_تطبيقية/box-footer -> Topic:ميكانيكا_تطبيقية/box-footer (no conflict) DRY RUN ONLY arwikiversity: id=1959 ns=0 dbk=Topic:ميكانيكا_تطبيقية/box-header -> Topic:ميكانيكا_تطبيقية/box-header (no conflict) DRY RUN ONLY arwikiversity: id=1949 ns=0 dbk=Topic:هندسة_ميكانيكية/Intro -> Topic:هندسة_ميكانيكية/Intro (no conflict) DRY RUN ONLY - Those pages belong to the Topic namespace <https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/Flow.namespaces.php#L12> (ns:2600) which is part of the Flow/Structured Discussions extension ("موضوع" <https://github.com/wikimedia/mediawiki-extensions-Flow/blob/master/Flow.namespaces.php#L17> is the Arabic translation of "Topic"). - Flow was uninstalled from all wikis where it had zero topics as per T188812: Uninstall Flow on all wikis where it has zero topics <https://phabricator.wikimedia.org/T188812> - There was an announcement <https://ar.wikiversity.org/w/index.php?title=%D9%88%D9%8A%D9%83%D9%8A_%D8%A7%D9%84%D8%AC%D8%A7%D9%85%D8%B9%D8%A9:%D8%A7%D9%84%D9%85%D9%8A%D8%AF%D8%A7%D9%86&oldid=63301#Disable_unused_Flow_extension> regarding disabling Flow on arwikiversity. - But the "Topic" namespace on arwikiversity actually had 5 pages <https://ar.wikiversity.org/wiki/%D8%AE%D8%A7%D8%B5:%D9%83%D9%84_%D8%A7%D9%84%D8%B5%D9%81%D8%AD%D8%A7%D8%AA?from=&to=&namespace=2600> in it (namespace not empty). - Statistics in T188812#4020445 <https://phabricator.wikimedia.org/T188812#4020445> for db in $( echo "select dbname from wiki" | sql meta ); do echo $db ; echo "select count(page_id) from page where page_namespace=2600" | sql $db ; done [...] 5 arwikiversity **Steps to Reproduce: ** Now back to Pywikibot, run the following command to fix broken redirects <https://ar.wikiversity.org/wiki/%D8%AE%D8%A7%D8%B5:%D8%AA%D8%AD%D9%88%D9%8A%D9%84%D8%A7%D8%AA_%D9%85%D9%83%D8%B3%D9%88%D8%B1%D8%A9> on arwikiverity: python pwb.py redirect broken -delete -lang:ar -family:wikiversity **Actual Results:** Retrieving broken redirect special page... Retrieving 9 pages from wikiversity:ar. WARNING: Page [[ar:الإمتصاص]] on wikiversity:ar is skipped because it is not a redirect WARNING: Page [[ar:باحث]] on wikiversity:ar is skipped because it is not a redirect WARNING: Page [[ar:لغة C++.Net]] on wikiversity:ar is skipped because it is not a redirect WARNING: Page [[ar:لغة Delphi.NET]] on wikiversity:ar is skipped because it is not a redirect WARNING: Page [[ar:مستقبل الكمبيوتر]] on wikiversity:ar is skipped because it is not a redirect WARNING: Page [[ar:وصف الجسد في اللغة الاسبانية]] on wikiversity:ar is skipped because it is not a redirect >>> موضوع:ميكانيكا تطبيقية <<< 0 pages read 0 pages written 6 pages skipped Execution time: 0 seconds Script terminated by exception: ERROR: RuntimeError: getredirtarget: No 'redirects' found for page موضوع:ميكانيكا تطبيقية. Traceback (most recent call last): File "pwb.py", line 298, in <module> if not main(): File "pwb.py", line 293, in main run_python_file(filename, [filename] + args, argvu, file_package) File "pwb.py", line 96, in run_python_file main_mod.__dict__) File "./scripts/redirect.py", line 770, in <module> main() File "./scripts/redirect.py", line 766, in main bot.run() File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/bot.py", line 1511, in run self.treat(page) File "./scripts/redirect.py", line 679, in treat super(RedirectRobot, self).treat(page) File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/bot.py", line 1738, in treat self.treat_page() File "./scripts/redirect.py", line 489, in delete_1_broken_redirect targetPage = redir_page.getRedirectTarget() File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/page.py", line 1683, in getRedirectTarget return self.site.getredirtarget(self) File "/mnt/nfs/labstore-secondary-tools-home/meno25/core/pywikibot/site.py", line 3198, in getredirtarget .format(title)) RuntimeError: <exception str() failed> CRITICAL: Exiting due to uncaught exception <type 'exceptions.RuntimeError'> **Expected Results:** - The script should either skip those pages silently or print an error message to the user and continue but I don't believe that crashing the script run like this is the desired behavior here. TASK DETAIL https://phabricator.wikimedia.org/T224707 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: Meno25 Cc: Aklapper, alanajjar, Meno25, pywikibot-bugs-list, Viztor, DannyS712, Wenyi, Tbscho, MayS, Mdupont, JJMC89, Dvorapa, Avicennasis, mys_721tx, Xqt, jayvdb, Masti, Alchimista, Rxy
_______________________________________________ pywikibot-bugs mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs
