Summary: | app-portage/gentoolkit-0.3.0_rc11-r3: Can't cope with empty string for locale.getpreferredencoding() | ||
---|---|---|---|
Product: | Gentoo/Alt | Reporter: | Charles Davis <cdavis5x> |
Component: | Prefix Support | Assignee: | Gentoo Prefix <prefix> |
Status: | RESOLVED NEEDINFO | ||
Severity: | normal | ||
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | OS X | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- |
Description
Charles Davis
2011-01-09 23:38:55 UTC
Maybe this "helps": % python2.7 Python 2.7.1 (r271:86832, Jan 8 2011, 15:13:43) [GCC 4.2.1 (Gentoo 4.2.1_p5664, Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getpreferredencoding() 'UTF-8' >>> % python2.6 Python 2.6.5 (release26-maint, Oct 24 2010, 23:38:28) [GCC 4.2.1 (Gentoo 4.2.1_p5664, Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.getpreferredencoding() 'mac-roman' >>> It does. What does 'locale' say for you? Here's what it says for me: LANG= LC_COLLATE="C" LC_CTYPE="C" LC_MESSAGES="C" LC_MONETARY="C" LC_NUMERIC="C" LC_TIME="C" LC_ALL= For some reason, setting LANG, LC_CTYPE, or LC_ALL to anything--anything at all, even a non-existent locale--causes locale.getpreferredencoding(True) to succeed, and return a nonzero-length string. I wonder why that is. I set my locale to en_gb.UTF-8, I knew that upfront :) Python-2.7 now actually listens to the environment iso hardcoding this stupid macroman. I guess there is no more issue here? |