Did I find the right examples for you? yes no

All Samples(4)  |  Call(3)  |  Derive(0)  |  Import(1)
Sometimes you get an URL by a user that just isn't a real
URL because it contains unsafe characters like ' ' and so on.  This
function can fix some of the problems in a similar way browsers
handle data entered by the user:

>>> url_fix(u'http://de.wikipedia.org/wiki/Elf (Begriffsklärung)')
'http://de.wikipedia.org/wiki/Elf%20%28Begriffskl%C3%A4rung%29'

:param s: Url address.
:type s: string(more...)

        def url_fix(s, charset='utf-8'):
    '''
    Sometimes you get an URL by a user that just isn't a real
    URL because it contains unsafe characters like ' ' and so on.  This
    function can fix some of the problems in a similar way browsers
    handle data entered by the user:

    >>> url_fix(u'http://de.wikipedia.org/wiki/Elf (Begriffsklärung)')
    'http://de.wikipedia.org/wiki/Elf%20%28Begriffskl%C3%A4rung%29'

    :param s: Url address.
    :type s: string
    :param charset: The target charset for the URL if the url was
                    given as unicode string. Default is 'utf-8'.
    :type charset: string
    :rtype: string
                    
    (taken from `werkzeug.utils `_)
    '''
    if sys.version_info < (3, 0) and 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((scheme, netloc, path, qs, anchor))
        


src/g/o/goto-0.1.3/goto/goto.py   goto(Download)
    from StringIO import StringIO
 
from utils import url_fix, cached_property, extras, encoded_unique_items 
from utils import cj_dumps,  cj_from_dump, cj_from_dict, cj_from
from useragents import USER_AGENTS
        **log_dir = dir for the pages log
    '''
    url = url_fix(url, charset)
    if get:
        if '#' in url:
    req.add_header('User-agent', user_agent)
    if referer:
        req.add_header('Referer', url_fix(referer))
    cookies = cj_from(cookies, req)
    handlers = [urllib2.HTTPCookieProcessor(cookies)]

src/p/y/pySmartDL-1.2.2/pySmartDL/pySmartDL.py   pySmartDL(Download)
    def __init__(self, urls, dest=None, progress_bar=True, logger=None, connect_default_logger=False):
        self.mirrors = [urls] if isinstance(urls, basestring) else urls
        self.mirrors = [utils.url_fix(x) for x in self.mirrors]
        self.url = self.mirrors.pop(0)