From a766d323182161f69545c7c6462a27b36f38f605 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Martin=20v=2E=20L=C3=B6wis?= Date: Thu, 12 Aug 2004 13:14:20 +0000 Subject: [PATCH] Ignore the locale's encoding if it is an empty string. --- Lib/idlelib/IOBinding.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index bddd4d6d525d..eb2b1ed3e524 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) -- 2.47.3