On Thu, Mar 10, 2016 at 11:34 PM, Morten Wang <[email protected]> wrote:
> Found the following error in my logs:
>
> Traceback (most recent call last):
>   File "/data/project/suggestbot/projects/opentask/opentask.py", line 32, in
> <module>
>     import pywikibot
>   File "/shared/pywikipedia/core/pywikibot/__init__.py", line 37, in
> <module>
>     from pywikibot import config2 as config
>   File "/shared/pywikipedia/core/pywikibot/config2.py", line 1090, in
> <module>
>     userinterface_lang = getdefaultlocale()[0].split('_')[0]
> AttributeError: 'NoneType' object has no attribute 'split'
>
> opentask.py updates the English Wikipedia Community portal's list of open
> tasks regularly and is run through Tool Labs grid engine. Explicitly setting
> the locale in the shell script that launches it appears to not trigger this
> error.

Thanks for raising this.

It was logged as https://phabricator.wikimedia.org/T129406, and a fix
has been merged.  My apologies for the disruption.

Any script can now become more i18n-aware by using
`pywikibot.config.userinterface_lang`, which is now set to the user
locale on Unix and Windows.

This has long been a feature of the i18n module's "input" method,
which was used for getting a response from the user with a prompt in
the user's locale language, but it may now be used for other i18n
purposes.

-- 
John Vandenberg

_______________________________________________
pywikibot mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/pywikibot

Reply via email to