[Python-checkins] cpython (2.7): Close #3067: locale.setlocale() accepts a Unicode locale.
victor.stinner
python-checkins at python.org
Mon Jun 20 16:14:55 CEST 2011
http://hg.python.org/cpython/rev/d370d609d09b
changeset: 70902:d370d609d09b
branch: 2.7
parent: 70891:6c16a31e0442
user: Victor Stinner <victor.stinner at haypocalc.com>
date: Mon Jun 20 16:14:48 2011 +0200
summary:
Close #3067: locale.setlocale() accepts a Unicode locale.
files:
Lib/locale.py | 2 +-
Misc/NEWS | 2 ++
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Lib/locale.py b/Lib/locale.py
--- a/Lib/locale.py
+++ b/Lib/locale.py
@@ -525,7 +525,7 @@
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
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,8 @@
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.
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list