commit | edfba8244c6ec1a7aceeff69e304489478d9d7c7 | [log] [tgz] |
---|---|---|
author | Barry Warsaw <barry@python.org> | Mon Aug 15 19:17:12 2011 -0400 |
committer | Barry Warsaw <barry@python.org> | Mon Aug 15 19:17:12 2011 -0400 |
tree | a951f506150314328d222110328d8b5fd1a905d1 | |
parent | 5085e8ac67ba38527daf4537747a5f876f6e2da6 [diff] [blame] |
The simplest possible fix for the regression in bug 12752 by encoding unicodes to 8-bit strings.
diff --git a/Lib/locale.py b/Lib/locale.py index 166538d..0c4d652 100644 --- a/Lib/locale.py +++ b/Lib/locale.py
@@ -355,6 +355,8 @@ """ # Normalize the locale name and extract the encoding + if isinstance(localename, unicode): + localename = localename.encode('ascii') fullname = localename.translate(_ascii_lower_map) if ':' in fullname: # ':' is sometimes used as encoding delimiter.