def path_from_name(name, ext=None, sep=u'|'):
 if ext:
  return fsencode((name.replace(os.sep, sep) + ext))
 else:
  return fsencode(name.replace(os.sep, sep))

def path_from_name ( name , ext = None , sep = u'|' ) : if ext : return fsencode ( ( name . replace ( os . sep , sep ) + ext ) ) else : return fsencode ( name . replace ( os . sep , sep ) )
convert name with optional extension to file path .