def encode_path(p):
 if (not isinstance(p, unicode)):
  raise TypeError(u'Can only encode unicode, not {}'.format(type(p)))
 return p.encode(_FILESYSTEM_ENCODING)

def encode_path ( p ) : if ( not isinstance ( p , unicode ) ) : raise TypeError ( u'Can only encode unicode, not {}' . format ( type ( p ) ) ) return p . encode ( _FILESYSTEM_ENCODING )
encode the path specified as a list of path components using url encoding .