diff options
author | Martin v. Löwis <martin@v.loewis.de> | 2004-08-12 13:14:52 (GMT) |
---|---|---|
committer | Martin v. Löwis <martin@v.loewis.de> | 2004-08-12 13:14:52 (GMT) |
commit | a9170c7eac4801d39e1fa813688e6826245b2258 (patch) | |
tree | 5d168c4db4aae55b571662678ba117d7f05190a7 /Lib | |
parent | 68ba9a685d2627efb8ffdb54296e9b9892924cc9 (diff) | |
download | cpython-a9170c7eac4801d39e1fa813688e6826245b2258.zip cpython-a9170c7eac4801d39e1fa813688e6826245b2258.tar.gz cpython-a9170c7eac4801d39e1fa813688e6826245b2258.tar.bz2 |
Patch #808719: Ignore the locale's encoding if it is an empty string.
Backported to 2.3.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/idlelib/IOBinding.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index 7baf8cc..4d67292 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -48,7 +48,7 @@ else: # resulting codeset may be unknown to Python. We ignore all # these problems, falling back to ASCII encoding = locale.nl_langinfo(locale.CODESET) - if encoding is None: + if encoding is None or encoding is '': # situation occurs on Mac OS X encoding = 'ascii' codecs.lookup(encoding) @@ -58,7 +58,7 @@ else: # bugs that can cause ValueError. try: encoding = locale.getdefaultlocale()[1] - if encoding is None: + if encoding is None or encoding is '': # situation occurs on Mac OS X encoding = 'ascii' codecs.lookup(encoding) |