Tareq Alam

i have promises to keep and miles to go before i sleep – Robert Frost

python setlocale .. not working?make it work.. November 22, 2008

Filed under: Ubuntu, python — tareqalam @ 2:46 pm
Tags: , , , ,

when you are using the function in python:

locale.setlocale(locale.LC_ALL, ‘en_GB‘)

have you got this error message?

return _setlocale(category, locale)
locale.Error: unsupported locale setting

Then you should do what I have done in ubuntu..

This intelligent man helped me .. please go to this link and follow the steps to add the locale to the list of ’supported locales’

http://blog.andrewbeacock.com/2007/01/how-to-change-your-default-locale-on.html

Also I am writing it here for your convenience:

Edit /var/lib/locales/supported.d/local and add the following line:
en_GB ISO-8859-1

Then run the python script again .. hope it will not show error this time

THanks

 

Leave a Reply