[Pythonmac-SIG] Garbage Collection with Carbon

Brian Ray brianhray at gmail.com
Tue Apr 18 18:28:07 CEST 2006


Hi Python Mac People:


When I run the following:

###
import sys,os
import Carbon.File
import Carbon.CF

def fileurl(posix):
	fileref = Carbon.File.FSRef(posix)
	cfurl = Carbon.CF.CFURLCreateFromFSRef(fileref)
 	filestr = cfurl.CFURLGetString()
	return filestr.CFStringGetString()

if __name__ == "__main__":
	
	print fileurl("/tmp")
###

I get:


python(7038) malloc: *** error for object 0x3101f0: double free
python(7038) malloc: *** set a breakpoint in szone_error to debug
file://localhost/private/tmp/

Can anybody tell me what those errors mean? And BTW, does anybody know
if this code works fine with an untouched Tiger install. I am
considering making this an automater script and giving to some
friends. Although, the script does not work at all in Automator but
works on the command line with the result above. I wonder if this
makes Automator think the script failed?

tia, Brian Ray



with running python -v I get more info:

snip...
# /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/Carbon/CF.pyc
has bad mtime
import Carbon.CF # from
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/Carbon/CF.py
# can't create /System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/plat-mac/Carbon/CF.pyc
dlopen("/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/_CF.so",
2);
import _CF # dynamically loaded from
/System/Library/Frameworks/Python.framework/Versions/2.3/lib/python2.3/lib-dynload/_CF.so
python(7053) malloc: *** error for object 0x310200: double free
python(7053) malloc: *** set a breakpoint in szone_error to debug
file://localhost/private/tmp/
... snip


More information about the Pythonmac-SIG mailing list