]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Ignore the locale's encoding if it is an empty string.
authorMartin v. Löwis <martin@v.loewis.de>
Thu, 12 Aug 2004 13:14:20 +0000 (13:14 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Thu, 12 Aug 2004 13:14:20 +0000 (13:14 +0000)
Lib/idlelib/IOBinding.py

index bddd4d6d525dd42c7c79b8c4e9e549ab5e9c26ab..eb2b1ed3e524cf9d48ea7d23f4b9d1b691fee46e 100644 (file)
@@ -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)