def ensure_utf8(s):
 if isinstance(s, unicode):
  return s.encode('utf8')
 return s

def ensure_utf8 ( s ) : if isinstance ( s , unicode ) : return s . encode ( 'utf8' ) return s
not all of pyobjc and python understand unicode paths very well yet .