def url_path_replace(url, old, new, count=None):
    args = []
    scheme, netloc, path, query, fragment = urlparse.urlsplit(url)
    if count is not None:
        args.append(count)
    return urlparse.urlunsplit((
        scheme, netloc, path.replace(old, new, *args), query, fragment))
Return a copy of url with replaced path.
dataset/ETHPy150Open openstack/django_openstack_auth/openstack_auth/utils.py/url_path_replace