Page MenuHomePhabricator

months and numbers bug in interwiki.py (-wiktionary mode)
Closed, ResolvedPublic

Description

Running interwiki on wiktionary causes interesting bug:

When bot find page with name of some month or numbred pege (e.g. [[2]])

pwb.py interwiki -start:bý -wiktionary -family:wiktionary -lang:cs

-wiktionary parameter menas that bot tries to find the same-name page in other wiktionaries. But in this case it also tries non-existing wiktionaries.
and bot crashes (T74674)

...

NOTE: The first unfinished subject is [[cs:býložravec]]
NOTE: Number of pages queued is 50, trying to add 50 more.
TitleTranslate: březen was recognized as MonthName with value 3
Dump cs (wiktionary) written.
Traceback (most recent call last):
  File "I:\py\rewrite\pwb.py", line 213, in <module>
    run_python_file(filename, argv, argvu, file_package)
  File "I:\py\rewrite\pwb.py", line 82, in run_python_file
    main_mod.__dict__)
  File ".\scripts\interwiki.py", line 2644, in <module>
    main()
  File ".\scripts\interwiki.py", line 2619, in main
    bot.run()
  File ".\scripts\interwiki.py", line 2360, in run
    self.queryStep()
  File ".\scripts\interwiki.py", line 2333, in queryStep
    self.oneQuery()
  File ".\scripts\interwiki.py", line 2301, in oneQuery
    site = self.selectQuerySite()
  File ".\scripts\interwiki.py", line 2272, in selectQuerySite
    self.generateMore(globalvar.maxquerysize - mycount)
  File ".\scripts\interwiki.py", line 2219, in generateMore
    self.add(page, hints=globalvar.hints)
  File ".\scripts\interwiki.py", line 2127, in add
    subj = Subject(page, hints=hints)
  File ".\scripts\interwiki.py", line 870, in __init__
    self.translate(hints, globalvar.hintsareright)
  File ".\scripts\interwiki.py", line 940, in translate
    removebrackets=globalvar.hintnobracket)
  File "I:\py\rewrite\pywikibot\titletranslate.py", line 113, in translate
    fam=site.family))
  File "I:\py\rewrite\pywikibot\__init__.py", line 604, in Site
    _sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop)
  File "I:\py\rewrite\pywikibot\site.py", line 1520, in __init__
    BaseSite.__init__(self, code, fam, user, sysop)
  File "I:\py\rewrite\pywikibot\site.py", line 536, in __init__
    % (self.__code, self.__family.name))
pywikibot.exceptions.UnknownSite: Language 'sco' does not exist in family wiktio
nary
<class 'pywikibot.exceptions.UnknownSite'>
CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort

I:\py\rewrite>

Event Timeline

JAnD raised the priority of this task from to Medium.
JAnD updated the task description. (Show Details)
JAnD subscribed.
Restricted Application added subscribers: Aklapper, Unknown Object (MLST). · View Herald TranscriptMar 7 2015, 9:30 PM
jayvdb renamed this task from months and numers bug in interwiki.py (-wiktionary mode) to months and numbers bug in interwiki.py (-wiktionary mode).May 8 2015, 4:29 AM
jayvdb set Security to None.

Change 211971 had a related patch set uploaded (by Ladsgroup):
titletranslate.py shouldn't check non-existed wikis

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

Change 211971 merged by jenkins-bot:
titletranslate.py shouldn't check non-existed wikis

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