Hi all,

I'm new in Python, so I'm reading 3.1 tutorial and now I've got a question
about locale.setlocale function. I've tryed in python idle this:

import locale

locale.setlocale(locale.LC_ALL, 'English_United States.1252')

and i got:

Traceback (most recent call last):
  File "<pyshell#40>", line 1, in <module>
    locale.setlocale(locale.LC_ALL,'English_United States.1252')
  File "/usr/lib/python3.1/locale.py", line 527, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

After that I checked locale.py trying to know which locale settings are
supported I found:

def setlocale(category, value=None):
        """ setlocale(integer,string=None) -> string.
            Activates/queries locale processing.
        """
        if value not in (None, '', 'C'):
            raise Error('_locale emulation only supports "C" locale')
        return 'C'

So here I can use only default (es_ES.utf8) and C locales, but how can I use
any other locale?

Bye
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to