Author albertjan
Recipients albertjan, ronaldoussoren
Date 2014-03-20.18:50:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395341408.25.0.421765471202.issue20999@psf.upfronthosting.co.za>
In-reply-to
Content
------------->> see also issue #18378

# Result applies to Python 2.7.2 and Python 3.3.4
# Mac OS X Mountain Lion 10.9.1 on Virtualbox with a Linux Debian AMD-64 host
fomcls-Mac-Pro:~ fomcl$ uname -a
Darwin fomcls-Mac-Pro.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_6

>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'C/UTF-8/C/C/C/C'
>>> locale.getlocale()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 515, in getlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 428, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

########################################################################
# below another configuration (no hackintosh)
########################################################################


conda 2.7:

Python 2.7.6 |Continuum Analytics, Inc.| (default, Jan 10 2014, 11:23:15)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'C'
>>> locale.getlocale()
(None, None)

conda 3.3:

Python 3.3.5 |Continuum Analytics, Inc.| (default, Mar 10 2014, 11:22:25)
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'C'
>>> locale.getlocale()
(None, None)

Regular 2.7:

Python 2.7.5 (default, Aug 25 2013, 00:04:04)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'C'
>>> locale.getlocale()
(None, None)
>>>


Regular 3.3  (broken installation??)
Python 3.3.2 (v3.3.2:d047928ae3f6, May 13 2013, 13:52:24)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
Segmentation fault: 11


########################################################################
### finally, the expected result (on Linux)
########################################################################

antonia@antonia-HP-2133 ~ $ uname -a
Linux antonia-HP-2133 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux
Python 2.7.3 (default, Feb 27 2014, 19:39:10) [GCC 4.7.2] on linux2
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "")
'en_US.UTF-8'
>>> locale.getlocale()
('en_US', 'UTF-8')
History
Date User Action Args
2014-03-20 18:50:08albertjansetrecipients: + albertjan, ronaldoussoren
2014-03-20 18:50:08albertjansetmessageid: <1395341408.25.0.421765471202.issue20999@psf.upfronthosting.co.za>
2014-03-20 18:50:08albertjanlinkissue20999 messages
2014-03-20 18:50:07albertjancreate