How to use the pip._vendor.six.moves.urllib.parse.unquote function in pip

To help you get started, we’ve selected a few pip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github lambci / lambci / vendor / lib / python2.7 / site-packages / pip / _internal / download.py View on Github external
def parse_credentials(self, netloc):
        if "@" in netloc:
            userinfo = netloc.rsplit("@", 1)[0]
            if ":" in userinfo:
                user, pwd = userinfo.split(":", 1)
                return (urllib_unquote(user), urllib_unquote(pwd))
            return urllib_unquote(userinfo), None
        return None, None
github NoOne-hub / v2ray_client / venv / lib / python3.7 / site-packages / pip / _internal / download.py View on Github external
def parse_credentials(self, netloc):
        if "@" in netloc:
            userinfo = netloc.rsplit("@", 1)[0]
            if ":" in userinfo:
                user, pwd = userinfo.split(":", 1)
                return (urllib_unquote(user), urllib_unquote(pwd))
            return urllib_unquote(userinfo), None
        return None, None
github davidawad / SpaceShare / venv / lib / python2.7 / site-packages / pip / index.py View on Github external
def filename(self):
        _, netloc, path, _, _ = urllib_parse.urlsplit(self.url)
        name = posixpath.basename(path.rstrip('/')) or netloc
        name = urllib_parse.unquote(name)
        assert name, ('URL %r produced no filename' % self.url)
        return name
github ADEQUATeDQ / portalmonitor / env / lib / python2.7 / site-packages / pip / download.py View on Github external
match = _scheme_re.search(url)
    if match:
        scheme = match.group(1).lower()
        if (scheme == 'file' and comes_from and
                comes_from.startswith('http')):
            raise InstallationError(
                'Requirements file %s references URL %s, which is local'
                % (comes_from, url))
        if scheme == 'file':
            path = url.split(':', 1)[1]
            path = path.replace('\\', '/')
            match = _url_slash_drive_re.match(path)
            if match:
                path = match.group(1) + ':' + path.split('|', 1)[1]
            path = urllib_parse.unquote(path)
            if path.startswith('/'):
                path = '/' + path.lstrip('/')
            url = path
        else:
            # FIXME: catch some errors
            resp = session.get(url)
            resp.raise_for_status()

            if six.PY3:
                return resp.url, resp.text
            else:
                return resp.url, resp.content
    try:
        with open(url) as f:
            content = f.read()
    except IOError as exc:
github pantsbuild / pex / pex / vendor / _vendored / pip / pip / _internal / utils / misc.py View on Github external
return netloc, (None, None)

    # Split from the right because that's how urllib.parse.urlsplit()
    # behaves if more than one @ is present (which can be checked using
    # the password attribute of urlsplit()'s return value).
    auth, netloc = netloc.rsplit('@', 1)
    if ':' in auth:
        # Split from the left because that's how urllib.parse.urlsplit()
        # behaves if more than one : is present (which again can be checked
        # using the password attribute of the return value)
        user_pass = auth.split(':', 1)
    else:
        user_pass = auth, None

    user_pass = tuple(
        None if x is None else urllib_unquote(x) for x in user_pass
    )

    return netloc, user_pass
github ADEQUATeDQ / portalmonitor / env / lib / python2.7 / site-packages / pip / vcs / __init__.py View on Github external
def normalize_url(self, url):
        """
        Normalize a URL for comparison by unquoting it and removing any
        trailing slash.
        """
        return urllib_parse.unquote(url).rstrip('/')
github ali5h / rules_pip / third_party / py / pip / _internal / models / link.py View on Github external
def filename(self):
        # type: () -> str
        path = self.path.rstrip('/')
        name = posixpath.basename(path)
        if not name:
            # Make sure we don't leak auth information if the netloc
            # includes a username and password.
            netloc, user_pass = split_auth_from_netloc(self.netloc)
            return netloc

        name = urllib_parse.unquote(name)
        assert name, (
            'URL {self._url!r} produced no filename'.format(**locals()))
        return name
github jarrodparkes / mbox-to-csv / env / lib / python3.8 / site-packages / pip / _internal / models / link.py View on Github external
def path(self):
        # type: () -> str
        return urllib_parse.unquote(self._parsed_url.path)
github wonderworks-software / PyFlow / PyFlow / Python27 / Lib / site-packages / pip / vcs / __init__.py View on Github external
def normalize_url(self, url):
        """
        Normalize a URL for comparison by unquoting it and removing any
        trailing slash.
        """
        return urllib_parse.unquote(url).rstrip('/')