From: Victor Stinner Date: Mon, 20 Jun 2011 14:14:48 +0000 (+0200) Subject: Close #3067: locale.setlocale() accepts a Unicode locale. X-Git-Tag: v2.7.3rc1~684^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c36c6ccb416de0fc4a6635339fa7a7657085a1b7;p=thirdparty%2FPython%2Fcpython.git Close #3067: locale.setlocale() accepts a Unicode locale. --- diff --git a/Lib/locale.py b/Lib/locale.py index bb4aa37b2906..f204b564b93c 100644 --- a/Lib/locale.py +++ b/Lib/locale.py @@ -525,7 +525,7 @@ def setlocale(category, locale=None): category may be given as one of the LC_* values. """ - if locale and type(locale) is not type(""): + if locale and not isinstance(locale, basestring): # convert to string locale = normalize(_build_localename(locale)) return _setlocale(category, locale) diff --git a/Misc/NEWS b/Misc/NEWS index 2e33e7f5b801..d45582894ca7 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -16,6 +16,8 @@ Core and Builtins Library ------- +- Issue #3067: locale.setlocale() accepts a Unicode locale. + - Issue #11700: mailbox proxy object close methods can now be called multiple times without error, and _ProxyFile now closes the wrapped file.