This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vidartf
Recipients ezio.melotti, paul.moore, steve.dower, tim.golden, vidartf, vstinner, zach.ware
Date 2016-01-06.14:28:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The Norwegian locale on Windows has the honor of having the only locale name with a non-ASCII character ('Norwegian Bokmål_Norway', see e.g. It does not seem like python 3 is able to handle this properly, as the following code demonstrates:

Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_TIME, 'swedish')
>>> loc_sw = locale.getlocale(locale.LC_TIME)
>>> locale.setlocale(locale.LC_TIME, 'norwegian')
'Norwegian Bokmål_Norway.1252'
>>> loc_no = locale.getlocale(locale.LC_TIME)
>>> locale.setlocale(locale.LC_TIME, loc_sw)
>>> locale.setlocale(locale.LC_TIME, loc_no)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\prog\WinPython-64bit-\python-3.4.3.amd64\lib\", line 593, in setlocale
    return _setlocale(category, locale)
locale.Error: unsupported locale setting

As can be seen, this can be worked around when setting the locale manually, but if the locale has already been set to Norwegian, the value returned from getlocale is invalid when passed to setlocale.

Following the example of postgres in the link above, I suggest changing the behavior of locale.getlocale to alias 'Norwegian Bokmål_Norway.1252' as 'Norwegian_Norway.1252', which is completely ASCII, and therefore fine.
Date User Action Args
2016-01-06 14:28:10vidartfsetrecipients: + vidartf, paul.moore, vstinner, tim.golden, ezio.melotti, zach.ware, steve.dower
2016-01-06 14:28:10vidartfsetmessageid: <>
2016-01-06 14:28:10vidartflinkissue26024 messages
2016-01-06 14:28:09vidartfcreate