def make_path(*path_components):
 path_components = [quote(component) for component in path_components if component]
 path = '/'.join(path_components)
 if (not path.startswith('/')):
  path = ('/' + path)
 return path

def make_path ( * path_components ) : path_components = [ quote ( component ) for component in path_components if component ] path = '/' . join ( path_components ) if ( not path . startswith ( '/' ) ) : path = ( '/' + path ) return path
smash together the path components .