[Labs-l] Shared Pywikibot error when locale not set

Morten Wang nettrom at gmail.com
Thu Mar 10 16:34:40 UTC 2016


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.


Regards,
Morten
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.wikimedia.org/pipermail/labs-l/attachments/20160310/f4468ff7/attachment.html>


More information about the Labs-l mailing list