Dalba added a comment.

You are only defining a -family, but not a -lang, therefore pywikibot sets the provided -user for <-family>:<mylang>, where <mylang> is the default language defined in user-config.py. In this case, it's "cs", hence the warning UserWarning: Site i18n:i18n instantiated using different code "cs".

The correct call would be python pwb.py login -user:Dvorapa -family:i18n -lang:i18n.

We can enforce the -user on all sites within the specified -family, but that would be a little bit of a breaking change for those who may rely on the current behavior, i.e. they may want the user to be set only to config.mylang, but prefer to use their user-config values for other langs.

I am currently in favor of a solution to make pywikibot raise an error instead of just showing a warning for unknown languages on a family. But that would also be a breaking change.


TASK DETAIL
https://phabricator.wikimedia.org/T195921

EMAIL PREFERENCES
https://phabricator.wikimedia.org/settings/panel/emailpreferences/

To: Dalba
Cc: Dalba, Framawiki, Aklapper, pywikibot-bugs-list, Dvorapa, Sc4s2cg, Magul, Tbscho, MayS, Salgo60, Mdupont, JJMC89, Avicennasis, jayvdb, Masti, Alchimista, Rxy
_______________________________________________
pywikibot-bugs mailing list
pywikibot-bugs@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/pywikibot-bugs

Reply via email to