[New-bugs-announce] [issue6393] OS X: python3 from python-3.1.dmg crashes at startup
report at bugs.python.org
Wed Jul 1 12:51:57 CEST 2009
New submission from Mark Dickinson <dickinsm at gmail.com>:
There was a report on c.l.p. that python3 from the OS X Python 3.1
dmg download at www.python.org/download/releases/3.1/ crashes on
startup. I can reproduce this with the python.org download (using the
OS X Terminal) only with a bad locale setting:
newton:~ dickinsm$ LANG=utf-8 python3
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding:
Abort trap (core dumped)
The core dump isn't useful: just lots of 'No symbol table info
This is on OS X 10.5.7/Intel.
I can't reproduce it with either the py3k branch or the release31-maint
branch, built from scratch.
I suspect that this has to do with the behaviour of nl_langinfo(CODESET)
on OS X: namely, after doing (in C) setlocale(LC_CTYPE, ""), the result
of nl_langinfo(CODESET) appears to be "UTF-8" for well-defined utf-8
locales (e.g., 'en_US.UTF-8'), "US-ASCII" for meaningless locales (e.g.,
'invalid'), but one just gets "" for locales like 'utf-8' or 'en_US'.
This in turn affects Python's locale.getpreferredencoding function.
See also issue 2173, which may be related.
Ronald, any ideas?
components: Interpreter Core, Macintosh
nosy: marketdickinson, ronaldoussoren
title: OS X: python3 from python-3.1.dmg crashes at startup
versions: Python 3.1
Python tracker <report at bugs.python.org>
More information about the New-bugs-announce