Page MenuHomePhabricator

interwiki.py -hint: does not translate namespaces
Closed, ResolvedPublic

Description

pwb.py interwiki.py -prefixindex:User:JAn -family:wikiquote -hint:all

Retrieving 3 pages from wikiquote:cs.
NOTE: [[cs:Uživatel:JAnDbot]]: [[cs:Uživatel:JAnDbot]] gives duplicate interwiki
on same site [[sk:Redaktor:JAnDbot]]
NOTE: [[cs:Uživatel:JAn Dudík]]: [[cs:Uživatel:JAn Dudík]] gives duplicate inter
wiki on same site [[af:Gebruiker:JAn Dudík]]
NOTE: [[cs:Uživatel:JAn Dudík]]: [[cs:Uživatel:JAn Dudík]] gives duplicate inter
wiki on same site [[am:???:JAn Dudík]]
NOTE: [[cs:Uživatel:JAn Dudík]]: [[cs:Uživatel:JAn Dudík]] gives duplicate inter
wiki on same site [[ar:mstkhdm:JAn Dudík]]
NOTE: [[cs:Uživatel:JAn Dudík]]: [[cs:Uživatel:JAn Dudík]] gives duplicate inter
wiki on same site [[az:Istifadeçi:JAn Dudík]]
NOTE: [[cs:Uživatel:JAn Dudík]]: [[cs:Uživatel:JAn Dudík]] gives duplicate inter
wiki on same site [[be:Udzel'nik:JAn Dudík]]
NOTE: [[cs:Uživatel:JAn Dudík/common.js]] does not have any interwiki links
Retrieving 4 pages from wikiquote:az.
NOTE: [[az:Uživatel:JAnDbot]] does not exist. Skipping.
NOTE: [[az:Uživatel:JAn Dudík]] does not exist. Skipping.
NOTE: [[az:Uživatel:JAn Dudík/common.js]] does not exist. Skipping.
Retrieving 4 pages from wikiquote:sk.
NOTE: [[sk:Uživatel:JAnDbot]] does not exist. Skipping.
NOTE: [[sk:Uživatel:JAn Dudík]] does not exist. Skipping.
NOTE: [[sk:Uživatel:JAn Dudík/common.js]] does not exist. Skipping.
Retrieving 4 pages from wikiquote:be.
NOTE: [[be:Uživatel:JAnDbot]] does not exist. Skipping.
NOTE: [[be:Uživatel:JAn Dudík]] does not exist. Skipping.
NOTE: [[be:Uživatel:JAn Dudík/common.js]] does not exist. Skipping.
Retrieving 4 pages from wikiquote:am.
NOTE: [[am:Uživatel:JAnDbot]] does not exist. Skipping.
NOTE: [[am:Uživatel:JAn Dudík]] does not exist. Skipping.
NOTE: [[am:Uživatel:JAn Dudík/common.js]] does not exist. Skipping.
Retrieving 4 pages from wikiquote:af.
NOTE: [[af:Uživatel:JAnDbot]] does not exist. Skipping.
NOTE: [[af:Uživatel:JAn Dudík]] does not exist. Skipping.
NOTE: [[af:Uživatel:JAn Dudík/common.js]] does not exist. Skipping.
Retrieving 4 pages from wikiquote:ar.`

Script should search localized namespace

Event Timeline

JAnD raised the priority of this task from to Needs Triage.
JAnD updated the task description. (Show Details)
JAnD added a project: Pywikibot.
JAnD changed Security from none to None.
JAnD subscribed.
JAnD renamed this task from interwiki.py -hint:all does not translate namespaces to interwiki.py -hint: does not translate namespaces.Jan 9 2015, 1:38 PM
JAnD triaged this task as High priority.

I was able to reproduce it and I'm working on it right now.

Change 212879 had a related patch set uploaded (by Ladsgroup):
[FIX] Handle namespace in a language-agnositc way in titletranslate.py

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

Change 212879 merged by jenkins-bot:
[FIX] Handle namespace in a language-agnositc way in titletranslate.py

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

jayvdb reopened this task as Open.EditedJun 21 2015, 2:10 AM

Found a bug in the patch, and I'm working on a solution. Just need to save my current state and return to this later.

$ python3 pwb.py interwiki -wiktionary -simulate -hintsonly -family:wiktionary -lang:fr -hint:all:foo
...
Traceback (most recent call last):
  File "pwb.py", line 226, in <module>
    if not main():
  File "pwb.py", line 220, in main
    run_python_file(filename, [filename] + args, argvu, file_package)
  File "pwb.py", line 87, in run_python_file
    main_mod.__dict__)
  File "./scripts/interwiki.py", line 2634, in <module>
    main()
  File "./scripts/interwiki.py", line 2605, in main
    bot.add(singlePage, hints=globalvar.hints)
  File "./scripts/interwiki.py", line 2118, in add
    subj = Subject(page, hints=hints)
  File "./scripts/interwiki.py", line 868, in __init__
    self.translate(hints, globalvar.hintsareright)
  File "./scripts/interwiki.py", line 943, in translate
    site=site)
  File ".../pywikibot/tools/__init__.py", line 1227, in wrapper
    return obj(*__args, **__kw)
  File ".../pywikibot/titletranslate.py", line 83, in translate
    defaultNamespace=page.namespace())
AttributeError: 'NoneType' object has no attribute 'namespace'

Change 222606 had a related patch set uploaded (by John Vandenberg):
Fix bug in titletranslate

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

Change 222606 merged by jenkins-bot:
Allow titletranslate.translate page to be None

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

Change 243109 had a related patch set uploaded (by John Vandenberg):
Allow titletranslate.translate page to be None

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

Change 243109 merged by jenkins-bot:
Allow titletranslate.translate page to be None

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