Page MenuHomePhabricator

pywikibot does not respond to my calls
Closed, InvalidPublicBUG REPORT

Assigned To
None
Authored By
Sakura_emad
Mar 10 2023, 12:54 PM
Referenced Files
F36922960: image.png
Mar 22 2023, 6:31 PM
F36905042: pwb.py
Mar 10 2023, 1:35 PM
F36905040: bot.py
Mar 10 2023, 1:35 PM
F36905039: catks.py
Mar 10 2023, 1:35 PM
F36905035: image.png
Mar 10 2023, 1:30 PM
F36904988: image.png
Mar 10 2023, 12:54 PM

Description

i use pywikibot alot, and recently i came across a strange problem

image.png (902×1 px, 115 KB)

as you can see it says the program does not recognize 'gur' language, but if you look at my command i requested -lang:ks, which stands for kswiki, i never requested gurwiki, so why i get this error message when i run my bot on ksiwki? does it have anything with update? do i have to update my pywikibot?

Event Timeline

same

image.png (846×1 px, 106 KB)
thing happened again, it run for a while and then this time instead of 'gur' language 'guc'' language appeared, they were never required in the first place, so what's with this error?

i see on the error these files are not working properly because error occured on some lines i will upload each file:.



image.png (1×1 px, 129 KB)
at this rate i don't think i will ever be able to run the bot on any projects.

Try to use global options right after pwb.py, before the script name. What happens?

fwiw I could replicate this on the pip installed version of pywikibot, but when I cloned https://github.com/wikimedia/pywikibot to be able to run it with a debugger a bit easier, it's now running okay... are you able to try that instead?

Might also be worth trying the version on PAWS?

I think -lang:ckb is the false trace here. The upstream call that throws the exception is langlinks = page.langlinks(). There is probably an interwiki link to a site that Pywikibot does not recognize.

@Sakura_emad: what is your Pywikibot release? Try the following within shell:

D:\pwb\GIT\core>pwb shell
Welcome to the Pywikibot interactive shell!
>>> for lang in ('guc', 'gur', 'ks'): pywikibot.Site('wikipedia:' + lang)
...
APISite("guc", "wikipedia")
APISite("gur", "wikipedia")
APISite("ks", "wikipedia")
>>>

Does this fail?

Like @matej_suchanek I think there are interlanguage links found which aren't lazy loaded and some language codes are missing in your family file:

anp-wiki was introduced with current master 8.1 (rPWBC4bfc86d) due to T332115. I've backported it to stable 8.0.2 now.
guc-wiki was introduced with 8.0.1 stable release (rPWBCff6070b)
gur-wiki was introduced with 8.0.1 stable release (rPWBC526a622)

There are three ways to get the bot running (I guess):

  1. update to master branch ** may be ok but be aware that this branch is under development and may have bugs
  2. update to stable branch 8.0.2 ** recommended
  3. add the missing language codes to languages_by_size list in wikipedia_family.py ** not recommended. Be aware that this can lead to a version conflict when updating the framework later

@Xqt shall download pywikibot from scratch again?

@Xqt shall download pywikibot from scratch again?

If you are using a svn or git repository, just update it. If you have installed it from pypi also update it. If you have downloaded the framework from nightly e.g. Pywikibot.org you have to download it again. Or update the family file as described above.