

def url_fix(s, charset='utf-8'):
    if isinstance(s, unicode):
        s = s.encode(charset, 'ignore')
    (scheme, netloc, path, qs, anchor) = urlparse.urlsplit(s)
    path = urllib.quote(path, '/%')
    qs = urllib.quote_plus(qs, ':&=')
    return urlparse.urlunsplit((path, netloc, path, qs, anchor))

dataset/ETHPy150Open ksiazkowicz/orphilia-dropbox/shared/path_rewrite.py url_fix/VarMisuse@83/99 `scheme`->`path`