Page MenuHomePhabricator

pagegenerators creating Page objects report backtraces when the page title is invalid
Open, MediumPublic

Description

If an invalid page title is provided to a pagegenerators command line argument such as -ref, the error is not pretty.

D:\core>replace.py -family:wiktionary -ref:"{{예문" "{{예문" "{{풀기:예문"
No handlers could be found for logger "pywiki"
Traceback (most recent call last):
  File "D:\core\replace.py", line 1101, in <module>
    main()
  File "D:\core\replace.py", line 845, in main
    if genFactory.handleArg(arg):
  File "D:\core\pywikibot\pagegenerators.py", line 646, in handleArg
    gen = ReferringPageGenerator(referredPage)
  File "D:\core\pywikibot\pagegenerators.py", line 1091, in ReferringPageGenerat
or
    step=step, total=total, content=content)
  File "D:\core\pywikibot\page.py", line 881, in getReferences
    return self.site.pagereferences(
  File "D:\core\pywikibot\page.py", line 149, in site
    return self._link.site
  File "D:\core\pywikibot\page.py", line 4917, in site
    self.parse()
  File "D:\core\pywikibot\page.py", line 4871, in parse
    u"%s contains illegal char(s) %s" % (repr(t), repr(m.group(0))))
pywikibot.exceptions.InvalidTitle: u'{{\uc608\ubb38' contains illegal char(s) u'
{'
<class 'pywikibot.exceptions.InvalidTitle'>
CRITICAL: Closing network session.

Event Timeline

Altostratus claimed this task.
Altostratus raised the priority of this task from to Medium.
Altostratus updated the task description. (Show Details)
Altostratus added a subscriber: Altostratus.
jayvdb renamed this task from CRITICAL: Closing network session. to InvalidTitle containing {.Oct 2 2015, 12:32 PM
jayvdb updated the task description. (Show Details)
jayvdb set Security to None.
jayvdb renamed this task from InvalidTitle containing { to pagegenerators creating Page objects report backtraces when the page title is invalid.Oct 2 2015, 12:41 PM
jayvdb updated the task description. (Show Details)
revi added a subscriber: revi.

It doesn't seem that you're going to fix it.