def asciify_path(path, sep_replace):
 if os.altsep:
  path = path.replace(os.altsep, os.sep)
 path_components = path.split(os.sep)
 for (index, item) in enumerate(path_components):
  path_components[index] = unidecode(item).replace(os.sep, sep_replace)
  if os.altsep:
   path_components[index] = unidecode(item).replace(os.altsep, sep_replace)
 return os.sep.join(path_components)

def asciify_path ( path , sep_replace ) : if os . altsep : path = path . replace ( os . altsep , os . sep ) path_components = path . split ( os . sep ) for ( index , item ) in enumerate ( path_components ) : path_components [ index ] = unidecode ( item ) . replace ( os . sep , sep_replace ) if os . altsep : path_components [ index ] = unidecode ( item ) . replace ( os . altsep , sep_replace ) return os . sep . join ( path_components )
decodes all unicode characters in a path into ascii equivalents .