LE 9.1.002 (Kodi Leia 18.3) produces a locale error on a Raspberry Pi 2

  • I've written a kodi add-on that successfully runs under LE 8.2.5 and under Kodi Leia running on a windows 10 computer. However, when I run my add-on using LE version 9.1.002 on a Raspberry Pi 2, I get the following error:

    This is the code snippet from the module that produced the error:

    Python
    from datetime import datetime, timedelta
    import locale
    
    __Version__ = "1.1.0"
    
    locale.setlocale(locale.LC_ALL, '')

    This is the same code that's found in the locale documentation found here.

    Code
    import locale
    locale.setlocale(locale.LC_ALL, '')

    I've never seen this error under any other OS running my add-on and am really puzzled why it's happening.

    Does anyone have any suggestions on how to fix this problem?

  • I believe I may have found the cause of the problem.

    One of my Python reference books made the following statement:

    Quote

    "The locale must be installed on the OS, otherwise setlocale raises a locale Error: unsupported locale setting exception."

    From: Ramalho, Luciano. Fluent Python: Clear, Concise, and Effective Programming (p. 130). O'Reilly Media. Kindle Edition.

    So I'm hypothesizing that the locale must not be installed in LE version 9.1.002.

    chewitt, If my hypothesis is correct, is there anything I can do to fix the problem short of recompiling?