[Pythonmac-SIG] Garbage Collection with Carbon
Ronald Oussoren
ronaldoussoren at mac.com
Tue Apr 18 19:15:44 CEST 2006
On 18-apr-2006, at 18:28, Brian Ray wrote:
> 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?
This means there's a bug in the Carbon wrappers. I can reproduce this
with my universal build as well as /usr/bin/python.
Ronald
More information about the Pythonmac-SIG
mailing list