https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
Bug ID: 72674 Summary: Key error: u'za' in interwiki.py Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: NEW Severity: major Priority: Unprioritized Component: interwiki.py Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: jan.dudik@gmail.com Web browser: --- Mobile Platform: ---
D:\Py\rewrite>pwb.py interwiki -family:wiktionary -cleanup -start:category:Finština -array:50 -query:30 -untranslated
NOTE: Number of pages queued is 0, trying to add 30 more. Retrieving 30 pages from wiktionary:cs. ERROR: Traceback (most recent call last): File "D:\Py\rewrite\pywikibot\data\api.py", line 584, in submit headers=headers, body=body) File "D:\Py\rewrite\pywikibot\tools.py", line 549, in wrapper return obj(*__args, **__kw) File "D:\Py\rewrite\pywikibot\comms\http.py", line 232, in request host = site.ssl_hostname() File "D:\Py\rewrite\pywikibot\site.py", line 550, in <lambda> f = lambda *args, **kwargs: method(self.code, *args, **kwargs) File "D:\Py\rewrite\pywikibot\family.py", line 994, in ssl_hostname return self.hostname(code) File "D:\Py\rewrite\pywikibot\family.py", line 990, in hostname return self.langs[code] KeyError: u'za'
WARNING: Waiting 5 seconds before retrying. ... WARNING: Waiting 10 seconds before retrying.
etc.
note:the only file containing "u'Za'" is imageuncat.py
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
--- Comment #1 from JAn Dudík jan.dudik@gmail.com --- I found connection with https://bugzilla.wikimedia.org/show_bug.cgi?id=71115
When is in some page present old interwiki to za:, bot have this problem and cannot continue
after https://cs.wiktionary.org/w/index.php?title=Kategorie:Francouz%C5%A1tina&... this edit bot works as expected
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
Mpaa mpaa.wiki@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |mpaa.wiki@gmail.com See Also| |https://bugzilla.wikimedia. | |org/show_bug.cgi?id=71115
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
--- Comment #2 from JAn Dudík jan.dudik@gmail.com --- Similar problem with language on incubator
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
--- Comment #3 from JAn Dudík jan.dudik@gmail.com --- (In reply to JAn Dudík from comment #2)
Similar problem with language on incubator
I mean when is in page interwiki to non existing wiktionary ([[wikt:bar:Category:Foo]] does not exist neither allone nor in incubator) bot crashes
example: https://csb.wiktionary.org/w/index.php?title=Kateg%C3%B2r%C3%ABj%C3%B4:J%C3%...
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
--- Comment #4 from JAn Dudík jan.dudik@gmail.com --- ... Retrieving 30 pages from wiktionary:de. Dump cs (wiktionary) written. Traceback (most recent call last): File "D:\Py\rewrite\pwb.py", line 178, in <module> run_python_file(fn, argv, argvu) File "D:\Py\rewrite\pwb.py", line 75, in run_python_file exec(compile(source, filename, "exec"), main_mod.__dict__) File "D:\Py\rewrite\scripts\interwiki.py", line 2646, in <module> main() File "D:\Py\rewrite\scripts\interwiki.py", line 2621, in main bot.run() File "D:\Py\rewrite\scripts\interwiki.py", line 2365, in run self.queryStep() File "D:\Py\rewrite\scripts\interwiki.py", line 2338, in queryStep self.oneQuery() File "D:\Py\rewrite\scripts\interwiki.py", line 2328, in oneQuery for page in gen: File "D:\Py\rewrite\pywikibot\site.py", line 2430, in preloadpages api.update_page(page, pagedata, rvgen.props) File "D:\Py\rewrite\pywikibot\data\api.py", line 1480, in update_page source=page.site) File "D:\Py\rewrite\pywikibot\page.py", line 4371, in langlinkUnsafe link._site = pywikibot.Site(lang, source.family.name) File "D:\Py\rewrite\pywikibot__init__.py", line 573, in Site _sites[key] = interface(code=code, fam=fam, user=user, sysop=sysop) File "D:\Py\rewrite\pywikibot\site.py", line 1399, in __init__ BaseSite.__init__(self, code, fam, user, sysop) File "D:\Py\rewrite\pywikibot\site.py", line 439, in __init__ % (self.__code, self.__family.name)) pywikibot.exceptions.UnknownSite: Language ht does not exist in family wiktionary <class 'pywikibot.exceptions.UnknownSite'> CRITICAL: Waiting for 1 network thread(s) to finish. Press ctrl-c to abort
Bot should ignore <s>or remove</s> such link (ht:wiktionary exists on incubator)
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
Fabian CommodoreFabianus@gmx.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |CommodoreFabianus@gmx.de
--- Comment #5 from Fabian CommodoreFabianus@gmx.de --- What does the link look like in the incubator?
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
--- Comment #6 from JAn Dudík jan.dudik@gmail.com --- (In reply to Fabian from comment #5)
What does the link look like in the incubator?
[[wikt:ht:Kategori:Lang]] -> [[incubator:Wt/ht/Kategori:Lang]]
https://de.wiktionary.org/w/index.php?title=Kategorie:Sprachen&diff=prev...
https://bugzilla.wikimedia.org/show_bug.cgi?id=72674
--- Comment #7 from Fabian CommodoreFabianus@gmx.de --- Ah interesting. wikt:ht:X in the English Wikipedia is the same as ht:X in the English Wiktionary and while doesn't show a 'ht' interwiki prefix, the api does:
http://en.wiktionary.org/w/api.php?action=query&meta=siteinfo&siprop...
If you search for '"ht"' (with the double quotes) you find an entry which links to ht.wiktionary.org which itself redirects to the incubator.
When pwb is now analysing the link it thinks 'ht.wiktionary.org' is a wiktionary although it's on the incubator. So somehow our families system need to identify this because I don't know if a script could figure it out on it's own. So similar to the current obsolete system where one old language is referenced to a new one, the new system not only needs to reference to a new language but new site.
What we can't do is using the 'ht.wiktionary.org' as if nothing is happening:
http://ht.wiktionary.org/w/api.php?action=query&meta=siteinfo&siprop...
does not return an api call.
pywikipedia-bugs@lists.wikimedia.org