my code has:
def sep(num, lang='en', none_is_zero=False):
    if num is None:
        if none_is_zero is False:
            return None
        else:
            return 0
    try:
        locale.setlocale(locale.LC_ALL, lang)
    except locale.Error:
        locale.setlocale(locale.LC_ALL, 'en')
    return locale.format("%d", num, grouping=True)
since i was getting that error i tried to run this to test:
def test(bot, job):
    print(sep(12343, 'it'))
    print(sep(11425, 'en'))
    print(sep(1234235, None))
    print(sep(42345, ''))
    print(sep(2353636, 'gergreh'))
    print(sep(None, None))
and i get this error:
Traceback (most recent call last):
  File "/home/**/utils.py", line 192, in sep
    locale.setlocale(locale.LC_ALL, lang)
  File "/usr/lib/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/telegram/ext/jobqueue.py", line 286, in tick
    job.run(self.bot)
  File "/usr/local/lib/python3.5/dist-packages/telegram/ext/jobqueue.py", line 411, in run
    self.callback(bot, self)
  File "/home/**/utils.py", line 199, in test
    print(sep(12343, 'it'))
  File "/home/**/utils.py", line 194, in sep
    locale.setlocale(locale.LC_ALL, 'en')
  File "/usr/lib/python3.5/locale.py", line 594, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting
but i don't get any error on windows and the function works as expected. The problem is only on my ubuntu vps.
finding some answers on stackoverflow i saw someone suggesting to use 'en_US.UTF-8' and i tried and it works even on linux. But 'en.UTF-8' still doesn't work. i could append UTF-8 if it's needed but the api i use sometimes returns as lang_code only 'en', 'it', 'es'.
how can i get rid of this problem? on windows i don't have problems and it seems like the problem is just my linux vps with it, en etc
 
    