python3.2 ERROR on aix6.1
i compiled python3.2 on aix6.2 server, but it doesnt work. Pop error like this
Fatal Python error: Py_Initialize: Unable to get the locale encoding
UnicodeEncodeError: 'filesystemencoding' codec can't encode character '\uda18' in position 28: Invalid开发者_C百科 wide character
IOT/Abort trap(coredump)
Any help is welcome.
xxxxxxxxxxxxxx
/home/hei/bin>echo LANG:$LANG LC_CTYPE:$LC_CTYPE
LANG:Zh_CN.gbk LC_CTYPE:
/home/hei/bin>export LANG=en_US.utf-8 && ./python3 Could not find platform independent libraries Could not find platform dependent libraries Consider setting $PYTHONHOME to [:] ==================codeset[ISO8859-1] ==================CODESET[]
encoding[ISO8859-1]run _PyCodec_Lookup ERROR Fatal Python error: Py_Initialize: Unable to get the locale encoding UnicodeEncodeError: 'filesystemencoding' codec can't encode character '\uda18' in position 29: Invalid wide character IOT/Abort trap(coredump)
/home/hei/bin>export LANG=en_US.utf-8 && export PYTHONHOME=. && ./python3 ==================codeset[ISO8859-1] ==================CODESET[] encoding[ISO8859-1]run _PyCodec_Lookup ERROR Fatal Python error: Py_Initialize: Unable to get the locale encoding UnicodeEncodeError: 'filesystemencoding' codec can't encode character '\uda18' in position 2: Invalid wide character IOT/Abort trap(coredump)
This might need a lot of step by step debugging, since I can't imagine where that surrogate character came from.
First, do the following in your shell:
$ echo LANG:$LANG LC_CTYPE:$LC_CTYPE
Please update your question with the output of this command.
I suggest you use an encoding that is UTF-8 (e.g en_US.UTF-8
) if not already, and retry running Python.
It is also possible that the Python source code you have is not recent enough and is not patched for this (which actually is that) bug.
精彩评论