[Pythonmac-SIG] Carbon.CoreFoundation - null-terminated unicode strings??

has hengist.podd at virgin.net
Fri Mar 12 10:02:38 EST 2004


Hi,

Noticed the following strange behaviour; not entirely sure which 
code's responsible for it and can't help feeling it's some sort of 
bug, but maybe someone can shed some light on it?

#######

#!/usr/local/bin/pythonw

import Carbon.CoreFoundation as CF
from appscript import LaunchServices

path = 'TextEdit.app'

fURL = LaunchServices.LSFindApplicationForInfo ('????', None, path)[1]

print [c for c in 
(fURL.CFURLCopyFileSystemPath(CF.kCFURLPOSIXPathStyle).CFStringGetUnicode())]

--> [u'/', u'A', u'p', u'p', u'l', u'i', u'c', u'a', u't', u'i', 
u'o', u'n', u's', u'/', u'T', u'e', u'x', u't', u'E', u'd', u'i', 
u't', u'.', u'a', u'p', u'p', u'\x00'] -- why is last character 
0x00???

#######

Thanks,

has
-- 
http://freespace.virgin.net/hamish.sanderson/



More information about the Pythonmac-SIG mailing list