[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
New submission from cfr <[EMAIL PROTECTED]>: Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os, sys, locale >>> locale.getpreferredencoding() Bus error Sample crash report excerpt follows (plenty more available on request!). Note that the version of python given in the crash report is *not* the same as the version of python actually in use. I have never had an alpha version of python installed. The current version is the standard version of 2.5.2 available as a dmg download from python.org i.e. the universal framework build for 10.4. OS Version: 10.4.11 (Build 8S165) Report Version: 4 Command: Python Path: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python Parent: bash [27154] Version: 2.5a0 (2.5alpha0) PID:4692 Thread: 0 Exception: EXC_BAD_ACCESS (0x0001) Codes: KERN_PROTECTION_FAILURE (0x0002) at 0x Thread 0 Crashed: 0 com.apple.CoreFoundation0x907beac0 CFStringGetCStringPtr + 408 1 _locale.so 0x000f1cd8 PyLocale_getdefaultlocale + 328 (_localemodule.c:435) 2 org.python.python 0x002b393c PyEval_EvalFrameEx + 17036 (ceval.c:3557) 3 org.python.python 0x002b5e50 PyEval_EvalCodeEx + 2096 (ceval.c:2836) 4 org.python.python 0x002b3f48 PyEval_EvalFrameEx + 18584 (ceval.c:3669) 5 org.python.python 0x002b5e50 PyEval_EvalCodeEx + 2096 (ceval.c:2836) 6 org.python.python 0x002b5ff0 PyEval_EvalCode + 48 (ceval.c:500) 7 org.python.python 0x002dbb24 PyRun_InteractiveOneFlags + 772 (pythonrun.c:1274) 8 org.python.python 0x002dbd30 PyRun_InteractiveLoopFlags + 288 (pythonrun.c:725) 9 org.python.python 0x002dc3f0 PyRun_AnyFileExFlags + 176 (pythonrun.c:693) 10 org.python.python 0x002eba9c Py_Main + 3052 (main.c:523) 11 org.python.python 0x19bc 0x1000 + 2492 12 org.python.python 0x16c0 0x1000 + 1728 Thread 0 crashed with PPC Thread State 64: srr0: 0x907beac0 srr1: 0xd030 vrsave: 0x cr: 0x84244224 xer: 0x2004 lr: 0x907be930 ctr: 0x907be928 r0: 0xa07bb678 r1: 0xbfffd3a0 r2: 0xa07bb278 r3: 0x r4: 0x r5: 0xbfffd2e0 r6: 0x0005 r7: 0x0007 r8: 0x00702333 r9: 0x001c r10: 0x90bb4bb8 r11: 0x000f33d8 r12: 0x907be928 r13: 0x00058b24 r14: 0x00071e40 r15: 0x0006aa20 r16: 0x r17: 0x0001 r18: 0x000732a8 r19: 0x00619410 r20: 0x r21: 0x0006a9b0 r22: 0x r23: 0x00058b39 r24: 0x000f1b90 r25: 0x006001d0 r26: 0x0007e300 r27: 0x r28: 0x r29: 0xa07bbb6c r30: 0x r31: 0x907be930 Binary Images Description: 0x1000 - 0x1fff org.python.python 2.5a0 (2.5alpha0) /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python 0xa2000 -0xd9fff readline.so /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/readline.so 0xf -0xf2fff _locale.so /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/_locale.so 0x205000 - 0x323fff org.python.python 2.5a0 (2.5) /Library/Frameworks/Python.framework/Versions/2.5/Python 0x705000 - 0x74afff libncurses.5.dylib /Library/Frameworks/Python.framework/Versions/2.5/lib/libncurses.5.dylib 0x7de000 - 0x7e1fff operator.so /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/lib-dynload/operator.so 0x8fe0 - 0x8fe52fff dyld 46.16 /usr/lib/dyld 0x9000 - 0x901bcfff libSystem.B.dylib /usr/lib/libSystem.B.dylib 0x90214000 - 0x90219fff libmathCommon.A.dylib /usr/lib/system/libmathCommon.A.dylib 0x907bb000 - 0x90895fff com.apple.CoreFoundation 6.4.11 (368.35) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x908e - 0x909e2fff libicucore.A.dylib /usr/lib/libicucore.A.dylib 0x90a3c000 - 0x90ac0fff libobjc.A.dylib /usr/lib/libobjc.A.dylib 0x90aea000 - 0x90b5afff com.apple.framework.IOKit 1.4 (???) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit 0x90b7 - 0x90b82fff libauto.dylib /usr/lib/libauto.dylib 0x90b89000 - 0x90e60fff com.apple.CoreServices.CarbonCore 681.17 /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore 0x9000 - 0x9111ff
[issue3362] python version incorrectly reported in crash reports on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Although the active version of python on my machine is 2.5.2 and I have never had an alpha version installed, crash reports for python report the version as "2.5a0 (2.5alpha0)". Version details: active version of python is from the current python.org dmg download for Mac OS X 10.4 i.e. the universal framework build. When starting python, I get: Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. but in crash reports, I get: Command: Python Path: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python Parent: bash [27154] Version: 2.5a0 (2.5alpha0) and python is given as version 2.5a0 in the binary image listing which follows. Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC I think I did have 2.5.1 installed prior to installing 2.5.2 and I also have two older versions of python installed - 2.4 (also the python.org build) and 2.3 (as pre-installed by Apple) - but I never installed 2.5.0 or any version/candidate in the 2.5 line prior to 2.5.1. I'm not sure what further information might be helpful but would be happy to provide it on request. -- components: +None title: locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC -> python version incorrectly reported in crash reports on Mac OS X 10.4.11 PPC type: crash -> behavior ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
Changes by cfr <[EMAIL PROTECTED]>: -- title: python version incorrectly reported in crash reports on Mac OS X 10.4.11 PPC -> locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC type: behavior -> crash ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3363] python version incorrectly reported in crash reports on Mac OS X 10.4.11 PPC
New submission from cfr <[EMAIL PROTECTED]>: Although the active version of python on my machine is 2.5.2 and I have never had an alpha version installed, crash reports for python report the version as "2.5a0 (2.5alpha0)". Version details: active version of python is from the current python.org dmg download for Mac OS X 10.4 i.e. the universal framework build. When starting python, I get: Python 2.5.2 (r252:60911, Feb 22 2008, 07:57:53) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. but in crash reports, I get: Command: Python Path: /Library/Frameworks/Python.framework/Versions/2.5/Resources/Python.app/Contents/MacOS/Python Parent: bash [27154] Version: 2.5a0 (2.5alpha0) and python is given as version 2.5a0 in the binary image listing which follows. Darwin Kernel Version 8.11.0: Wed Oct 10 18:26:00 PDT 2007; root:xnu-792.24.17~1/RELEASE_PPC I think I did have 2.5.1 installed prior to installing 2.5.2 and I also have two older versions of python installed - 2.4 (also the python.org build) and 2.3 (as pre-installed by Apple) - but I never installed 2.5.0 or any version/candidate in the 2.5 line prior to 2.5.1. I'm not sure what further information might be helpful but would be happy to provide it on request. -- components: None messages: 69686 nosy: cfr severity: normal status: open title: python version incorrectly reported in crash reports on Mac OS X 10.4.11 PPC type: behavior versions: Python 2.5 ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3363> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Please ignore the second message. I thought I was creating a second bug report and cannot figure out anyway to edit it now I realise my error. I've just copied that to a second report with an appropriate header as I am assuming the two issues I'm seeing are distinct. This bug report is intended to cover the bus error I see triggered by locale.getpreferredencoding(). ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: I downloaded the current source (2.5.2) and confirmed that (1) python will build as a framework (for me) and (2) that the problem occurs for my build, too. I did not build it as a universal binary just in case that helped but mostly to speed things up. I then tried to add the --with-pydebug flag to my configure script and build that way. I used separate build directories for the two builds to keep the source clean. Unfortunately, make fails with the following error in that case: if test ""; then \ gcc -o Python.framework/Versions/2.5/Python -arch i386 -arch ppc -dynamiclib \ -isysroot "" \ -all_load libpython2.5.a -Wl,-single_module \ -install_name /Library/Frameworks/Python.framework/Versions/2.5/Python \ -compatibility_version 2.5 \ -current_version 2.5; \ else \ /usr/bin/libtool -o Python.framework/Versions/2.5/Python -dynamic libpython2.5.a \ -lSystem -lSystemStubs -arch_only ppc -install_name /Library/Frameworks/Python.framework/Versions/2.5/Python -compatibility_version 2.5 -current_version 2.5 ;\ fi ld: Undefined symbols: ___eprintf /usr/bin/libtool: internal link edit command failed make: *** [Python.framework/Versions/2.5/Python] Error 1 I am guessing that eprintf has something to do with the debug option because the symbol occurs in the debug version of libpython2.5.a but not the plain version as far as I can tell. But I'm not sure how to fix it. I am not even sure I am running the debugger correctly with the existing version of python. I tried passing "-v -v" and "-d" to python after reading the man page and that didn't get me any extra information. Nothing useful-looking, at least. ("-v -v" produced a lot of output beforehand but not around the point the error occurs.) Is that what you meant or should I be looking at something else? I am sorry but I don't know how to augment the source code with printf and that is such a common term I'm not sure what to google to find instructions for doing it. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: I figured out how to do this: Python 2.5.2 (r252:60911, Jul 16 2008, 01:44:22) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import pdb >>> import sys, os, locale >>> pdb.run('locale.getpreferredencoding()') > (1)() (Pdb) continue Bus error though I'm not sure if that is what I was meant to do either. (But it strikes me as another plausible possibility.) ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Thanks. I couldn't get anything from gdb which wasn't already in the crash log - likely because I don't know how to elicit the information correctly. Output from a build with the augmented _localemodule.c: ./python.exe Python 2.5.2 (r252:60911, Jul 16 2008, 01:44:22) [GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin iType "help", "copyright", "credits" or "license" for more information. >>> import os, sys, locale >>> locale.getpreferredencoding() The value of name is 0x0 It points to '(null)' Bus error ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: On the off chance this might be helpful: I get the same error with python 2.4.3. Python 2.4.3 (#1, Apr 7 2006, 10:54:33) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os, sys, locale >>> locale.getpreferredencoding() Bus error I do not get the error with the Apple-supplied python 2.3.5: Python 2.3.5 (#1, Mar 20 2005, 20:38:20) [GCC 3.3 20030304 (Apple Computer, Inc. build 1809)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import os, sys, locale >>> locale.getpreferredencoding() 'US-ASCII' ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: A work-around when using python from a shell environment (e.g. from a bash shell in Terminal) is to issue export __CF_USER_TEXT_ENCODING=0x1F5:0:0 before starting python. I haven't yet worked out how to apply this to GUI apps. I tried editing ~/.MacOSX/environment.plist and ~/.CFUserTextEncoding but neither strategy prevents the crash. I assume the fix works because it means one of the explicitly listed encodings matches so things never get as far as the code which triggers the error. Without the fix, my environment contained __CF_USER_TEXT_ENCODING=0x1F5:39:79 which does not, apparently, correspond to any of the encodings explicitly listed in _localemodule.c. - cfr ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Altering ~/.CFUserTextEncoding so it has the contents "0:0" and then rebooting seems to prevent the crash for GUI applications, too. Would like to know how to fix this properly, of course, since I suspect that the value on my machine was probably not "0:0" for a reason! ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: I admit to not understanding the code involved, but I *thought* that the problem involved cases where there *is* a preferred encoding in the environment but it is not one of those covered by: case kCFStringEncodingMacRoman: return "mac-roman"; case kCFStringEncodingMacGreek: return "mac-greek"; case kCFStringEncodingMacCyrillic: return "mac-cyrillic"; case kCFStringEncodingMacTurkish: return "mac-turkish"; case kCFStringEncodingMacIcelandic: return "mac-icelandic"; The work around basically ensures the preferred encoding given by the environment is one of those listed so that the rest of that part of the code doesn't run. I don't think that my crash, at least, resulted from no preferred encoding being defined in the environment but maybe something is going wrong in the locale module because it is not one from the standard list. Maybe? ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Interesting. At least the "39" makes sense. I don't understand the documentation well enough to know what the "79" is about. I'm sorry but I can't work out what I should do with: printf("Encoding is %x\n", enc); Am I meant to use this in python, a standard shell or something else? I tried in a bash shell and a python interpreter (after undoing my "work around") and both gave errors - a syntax error in the case of bash; a complaint about printf being unrecognised in python. I also tried "import os, sys, locale" first just in case. bash: syntax error near unexpected token `"Encoding is %x\n",' (python) Traceback (most recent call last): File "", line 1, in NameError: name 'printf' is not defined Sorry for being dumb about this. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Just realised what I'm meant to do with it. Sorry - it is late (early, actually). Will report back when I get a chance to recompile. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: It returns 27. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1099] Mac compile fails with pydebug and framework enabled
cfr <[EMAIL PROTECTED]> added the comment: Still fails for me on OS X 10.4.11 with latest available xcode (2.5). This is on PPC with the current stable release of python (2.5.2). ---configure script--- ../configure \ --enable-framework \ LDFLAGS=-L/usr/local/lib \ CFLAGS=-I/usr/local/include \ CPPFLAGS=-I/usr/local/include \ --with-pydebug \ ---error from make--- if test ""; then \ gcc -o Python.framework/Versions/2.5/Python -arch i386 -arch ppc -dynamiclib \ -isysroot "" \ -all_load libpython2.5.a -Wl,-single_module \ -install_name /Library/Frameworks/Python.framework/Versions/2.5/Python \ -compatibility_version 2.5 \ -current_version 2.5; \ else \ /usr/bin/libtool -o Python.framework/Versions/2.5/Python -dynamic libpython2.5.a \ -lSystem -lSystemStubs -arch_only ppc -install_name /Library/Frameworks/Python.framework/Versions/2.5/Python -compatibility_version 2.5 -current_version 2.5 ;\ fi ld: Undefined symbols: ___eprintf /usr/bin/libtool: internal link edit command failed make: *** [Python.framework/Versions/2.5/Python] Error 1 -- nosy: +cfr ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1099> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: I noticed there is an issue (http://bugs.python.org/issue1276) with Japanese Python users on Macs because the relevant codec is removed in Tools/unicode/Makefile. That file also removes a number of other codecs, including Mac Celtic. I just wondered if this might be related in some way because that issue report mentioned problems with getdefaultlocale etc. ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3362] locale.getpreferredencoding() gives bus error on Mac OS X 10.4.11 PPC
cfr <[EMAIL PROTECTED]> added the comment: Do you happen to know why it is returning 27? Is that correct or should it be returning something else (e.g. 39)? ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3362> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3549] Missing IDLE Preferences on Mac
cfr <[EMAIL PROTECTED]> added the comment: Also with Python 2.5.2 on OS X 10.4.11 (PPC but it is the universal installer): there is no Preferences... menu. The help mentions an Options menu. I don't know if that is the equivalent, but I cannot find that either. ------ nosy: +cfr ___ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue3549> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com