[issue21731] Calendar Problem with Windows (XP)

Jürgen B report at bugs.python.org
Thu Jun 12 13:38:21 CEST 2014


New submission from Jürgen B:

I had a problem with calendar.formatmonth()
Error message was 'Unsupported Locale'

Well, it seems that Windows (XP) does nothing accept to setlocale than ''

I changed /lib/calendar.py line 488 ff to
class different_locale:
    def __init__(self, locale):
        self.locale = locale

    def __enter__(self):
        _locale.setlocale(_locale.LC_TIME, '') # juebo
        self.oldlocale = _locale.getlocale(_locale.LC_TIME)
        # _locale.setlocale(_locale.LC_TIME, self.locale) # juebo

    def __exit__(self, *args):
        # _locale.setlocale(_locale.LC_TIME, self.oldlocale) #juebo
        _locale.setlocale(_locale.LC_TIME, '')

Well, I am absolute new to Python. So could anybody look over it

----------
components: Library (Lib)
messages: 220341
nosy: Juebo
priority: normal
severity: normal
status: open
title: Calendar Problem with Windows (XP)
type: compile error
versions: Python 2.7, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21731>
_______________________________________


More information about the Python-bugs-list mailing list