Page MenuHomePhabricator

checkimages.py: pywikibot.exceptions.InvalidTitle when run on Serbian wikis
Closed, InvalidPublic

Description

Hi, when I use checkimages.py on srwiki, and after few checks of files, I get this:

Traceback (most recent call last):
  File "pwb.py", line 250, in <module>
    if not main():
  File "pwb.py", line 243, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 95, in run_python_file
    main_mod.__dict__)
  File ".\scripts\checkimages.py", line 1804, in <module>
    ret = main()
  File ".\scripts\checkimages.py", line 1791, in main
    Bot.checkStep()
  File ".\scripts\checkimages.py", line 1541, in checkStep
    (license_found, hiddenTemplateFound) = self.smartDetection()
  File ".\scripts\checkimages.py", line 1282, in smartDetection
    if (tp.title(as_url=True, with_ns=False).lower()
  File "C:\Users\zoran\Desktop\pywiki\pywikibot\tools\__init__.py", line 1738, in wrapper
    return obj(*__args, **__kw)
  File "C:\Users\zoran\Desktop\pywiki\pywikibot\page.py", line 323, in title
    title = self._link.canonical_title()
  File "C:\Users\zoran\Desktop\pywiki\pywikibot\page.py", line 5805, in canonical_title
    if self.namespace != Namespace.MAIN:
  File "C:\Users\zoran\Desktop\pywiki\pywikibot\page.py", line 5766, in namespace
    self.parse()
  File "C:\Users\zoran\Desktop\pywiki\pywikibot\page.py", line 5710, in parse
    '%s contains illegal char(s) %s' % (repr(t), repr(m.group(0))))
pywikibot.exceptions.InvalidTitle: 'subst:[[Шаблон:Обавештење о датотеци без извора' contains illegal char(s) '['
CRITICAL: Exiting due to uncaught exception <class 'pywikibot.exceptions.InvalidTitle'>

Version:

Pywikibot: [ssh] pywikibot-core (91a8c7c, g10882, 2019/04/06, 11:44:15, ok)
Release version: 3.1.dev0
requests version: 2.21.0
  cacerts: C:\Program Files\Python37-32\lib\site-packages\certifi\cacert.pem
    certificate test: ok
Python: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 21:26:53) [MSC v.1916 32 bit (Intel)]
PYWIKIBOT_DIR: Not set
PYWIKIBOT_DIR_PWB:
PYWIKIBOT_NO_USER_CONFIG: Not set
Config base dir: C:\Users\zoran\Desktop\development\pywiki
Usernames for family "wikipedia":
        sr: ZoranBot (Zoranzoki21)

Event Timeline

17 images on srwiki contain this broken line:
<small>Не заборавите да обавестите пошиљаоца са:<br />{{subst:[[Шаблон:Обавештење о датотеци без извора|Обавештење о датотеци без извора]]|{{СТРАНИЦА}}}} <nowiki>--~~~~</nowiki></small>

This needs to be fixed on wiki

Dvorapa changed the task status from Open to Stalled.Mar 28 2020, 10:43 PM

Not issue with Pywikibot, also script works now correctly (for me).

(closing task as invalid)