This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author brianl
Recipients
Date 2002-09-29.00:20:20
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
My OS X laptop did not have LANG  set in the bash
envrionment and idle (AquaTK) failed to launch with an
AttributeError in IOBinding.py

        try:
            encoding = locale.getdefaultlocale()[1]
            codecs.lookup(encoding)
        except (ValueError, LookupError):
            pass

encoding = encoding.lower()
^^^^^

encoding is None here because locale.getdefaultlocale()
returns (None, None) when the locale can't be determined.

After finding that adding LANG=en_US to my .bashrc
didn't help, I Iearned OS X GUI apps don't use the
shell's environment, but do use whatever they find in
~/.MacOSX/environment.plist.  Adding a couple lines:

        <key>LANG</key>
        <string>en_US</string>

makes idle happy.   An alternative would be to make
sure encoding never gets set to None.

--- IOBinding.py.orig   Sat Sep 28 17:17:02 2002
+++ IOBinding.py        Sat Sep 28 17:17:42 2002
@@ -64,7 +64,7 @@
         # which may give a clue. Unfortunately,
getdefaultlocale has
         # bugs that can cause ValueError.
         try:
-            encoding = locale.getdefaultlocale()[1]
+            encoding = locale.getdefaultlocale()[1] or
'ascii'
             codecs.lookup(encoding)
         except (ValueError, LookupError):
             pass
 




 
 

History
Date User Action Args
2007-08-23 14:06:00adminlinkissue616002 messages
2007-08-23 14:06:00admincreate