Page MenuHomePhabricator

cosmetic_changes.py: ValueError: Title must be specified and not empty if source is a Site
Open, Needs TriagePublic

Description

Command line:

python pwb.py cosmetic_changes -page:"قالب:حاشية الصفحة الرئيسية" -site:wiktionary:ar

Output:

Retrieving 1 pages from wiktionary:ar.


>>> قالب:حاشية الصفحة الرئيسية <<<

0 pages read
0 pages written
0 pages skipped
Execution time: 1 seconds
Script terminated by exception:

ERROR: ValueError: Title must be specified and not empty if source is a Site.
Traceback (most recent call last):
  File "C:\Users\Mohammed\Downloads\core\pwb.py", line 494, in <module>
    main()
  File "C:\Users\Mohammed\Downloads\core\pwb.py", line 478, in main
    if not execute():
  File "C:\Users\Mohammed\Downloads\core\pwb.py", line 462, in execute
    run_python_file(filename, script_args, module)
  File "C:\Users\Mohammed\Downloads\core\pwb.py", line 143, in run_python_file
    exec(compile(source, filename, 'exec', dont_inherit=True),
  File ".\scripts\cosmetic_changes.py", line 136, in <module>
    main()
  File ".\scripts\cosmetic_changes.py", line 132, in main
    bot.run()
  File "C:\Users\Mohammed\Downloads\core\pywikibot\bot.py", line 1592, in run
    self.treat(page)
  File "C:\Users\Mohammed\Downloads\core\pywikibot\bot.py", line 1847, in treat
    self.treat_page()
  File ".\scripts\cosmetic_changes.py", line 89, in treat_page
    new_text = cc_toolkit.change(old_text)
  File "C:\Users\Mohammed\Downloads\core\pywikibot\cosmetic_changes.py", line 301, in change
    new_text = self._change(text)
  File "C:\Users\Mohammed\Downloads\core\pywikibot\cosmetic_changes.py", line 295, in _change
    text = self.safe_execute(method, text)
  File "C:\Users\Mohammed\Downloads\core\pywikibot\cosmetic_changes.py", line 282, in safe_execute
    result = method(text)
  File "C:\Users\Mohammed\Downloads\core\pywikibot\cosmetic_changes.py", line 362, in standardizePageFooter
    interwiki_links = textlib.getLanguageLinks(
  File "C:\Users\Mohammed\Downloads\core\pywikibot\textlib.py", line 1042, in getLanguageLinks
    page = pywikibot.Page(site, pagetitle)
  File "C:\Users\Mohammed\Downloads\core\pywikibot\page\__init__.py", line 2072, in __init__
    raise ValueError('Title must be specified and not empty '
ValueError: Title must be specified and not empty if source is a Site.
CRITICAL: Exiting due to uncaught exception <class 'ValueError'>

Output of version.py:

Pywikibot: [https] r-pywikibot-core (1b538a3, g15852, 2022/01/23, 08:22:25, master)
Release version: 7.0.0.dev0
setuptools version: 60.5.0
mwparserfromhell version: 0.6.3
wikitextparser version: n/a
requests version: 2.27.1
  cacerts: 
    certificate test: ok
Python: 3.10.2 (tags/v3.10.2:a58ebcc, Jan 17 2022, 14:12:15) [MSC v.1929 64 bit (AMD64)]

Notes:

Request:

  • Please make the bot skip the page (and not crash) when encountering such error, as it wastes a lot of time to restart the bot each time it encounters this error (when running on a whole namespace). Thank you.