The following issues were found

pipenv/vendor/dotenv/main.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from typing import (IO, Dict, Iterable, Iterator, Mapping, Optional, Tuple,
                    Union)

from .parser import Binding, parse_stream
from .variables import parse_variables

logger = logging.getLogger(__name__)

if sys.version_info >= (3, 6):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

                                  Union)

from .parser import Binding, parse_stream
from .variables import parse_variables

logger = logging.getLogger(__name__)

if sys.version_info >= (3, 6):
    _PathLike = os.PathLike

            

Reported by Pylint.

Unused argument 'quote_mode'
Error

Line: 185 Column: 5

              def unset_key(
    dotenv_path: Union[str, _PathLike],
    key_to_unset: str,
    quote_mode: str = "always",
) -> Tuple[Optional[bool], str]:
    """
    Removes a given key from the given .env

    If the .env path given doesn't exist, fails

            

Reported by Pylint.

Access to a protected member _getframe of a client class
Error

Line: 276 Column: 17

                      path = os.getcwd()
    else:
        # will work for .py files
        frame = sys._getframe()
        current_file = __file__

        while frame.f_code.co_filename == current_file:
            assert frame.f_back is not None
            frame = frame.f_back

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import io
import logging
import os
import shutil
import sys
import tempfile
from collections import OrderedDict
from contextlib import contextmanager
from typing import (IO, Dict, Iterable, Iterator, Mapping, Optional, Tuple,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 23 Column: 1

                  _PathLike = str


def with_warn_for_invalid_lines(mappings: Iterator[Binding]) -> Iterator[Binding]:
    for mapping in mappings:
        if mapping.error:
            logger.warning(
                "Python-dotenv could not parse statement starting at line %s",
                mapping.original.line,

            

Reported by Pylint.

Missing class docstring
Error

Line: 33 Column: 1

                      yield mapping


class DotEnv():
    def __init__(
        self,
        dotenv_path: Optional[Union[str, _PathLike]],
        stream: Optional[IO[str]] = None,
        verbose: bool = False,

            

Reported by Pylint.

Too many arguments (7/5)
Error

Line: 34 Column: 5

              

class DotEnv():
    def __init__(
        self,
        dotenv_path: Optional[Union[str, _PathLike]],
        stream: Optional[IO[str]] = None,
        verbose: bool = False,
        encoding: Union[None, str] = None,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 80 Column: 5

              
        return self._dict

    def parse(self) -> Iterator[Tuple[str, Optional[str]]]:
        with self._get_stream() as stream:
            for mapping in with_warn_for_invalid_lines(parse_stream(stream)):
                if mapping.key is not None:
                    yield mapping.key, mapping.value


            

Reported by Pylint.

Variable name "v" doesn't conform to snake_case naming style
Error

Line: 90 Column: 16

                      """
        Load the current dotenv as system environment variable.
        """
        for k, v in self.dict().items():
            if k in os.environ and not self.override:
                continue
            if v is not None:
                os.environ[k] = v


            

Reported by Pylint.

pipenv/vendor/wheel/wheelfile.py
15 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 60 Column: 17

                          try:
                record = self.open(self.record_path)
            except KeyError:
                raise WheelError('Missing {} file'.format(self.record_path))

            with record:
                for line in record:
                    line = line.decode('utf-8')
                    path, hash_sum, size = line.rsplit(u',', 2)

            

Reported by Pylint.

Unused variable 'size'
Error

Line: 65 Column: 37

                          with record:
                for line in record:
                    line = line.decode('utf-8')
                    path, hash_sum, size = line.rsplit(u',', 2)
                    if hash_sum:
                        algorithm, hash_sum = hash_sum.split(u'=')
                        try:
                            hashlib.new(algorithm)
                        except ValueError:

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 71 Column: 29

                                      try:
                            hashlib.new(algorithm)
                        except ValueError:
                            raise WheelError('Unsupported hash algorithm: {}'.format(algorithm))

                        if algorithm.lower() in {'md5', 'sha1'}:
                            raise WheelError(
                                'Weak hash algorithm ({}) is not permitted by PEP 427'
                                .format(algorithm))

            

Reported by Pylint.

Parameters differ from overridden 'open' method
Error

Line: 81 Column: 5

                                      self._file_hashes[path] = (
                            algorithm, urlsafe_b64decode(hash_sum.encode('ascii')))

    def open(self, name_or_info, mode="r", pwd=None):
        def _update_crc(newdata, eof=None):
            if eof is None:
                eof = ef._eof
                update_crc_orig(newdata)
            else:  # Python 2

            

Reported by Pylint.

Access to a protected member _eof of a client class
Error

Line: 84 Column: 23

                  def open(self, name_or_info, mode="r", pwd=None):
        def _update_crc(newdata, eof=None):
            if eof is None:
                eof = ef._eof
                update_crc_orig(newdata)
            else:  # Python 2
                update_crc_orig(newdata, eof)

            running_hash.update(newdata)

            

Reported by Pylint.

Access to a protected member _update_crc of a client class
Error

Line: 104 Column: 51

                          if expected_hash is not None:
                # Monkey patch the _update_crc method to also check for the hash from RECORD
                running_hash = hashlib.new(algorithm)
                update_crc_orig, ef._update_crc = ef._update_crc, _update_crc

        return ef

    def write_files(self, base_dir):
        logger.info("creating '%s' and adding '%s' to it", self.filename, base_dir)

            

Reported by Pylint.

Parameters differ from overridden 'write' method
Error

Line: 130 Column: 5

                      for path, arcname in deferred:
            self.write(path, arcname)

    def write(self, filename, arcname=None, compress_type=None):
        with open(filename, 'rb') as f:
            st = os.fstat(f.fileno())
            data = f.read()

        zinfo = ZipInfo(arcname or filename, date_time=get_zipinfo_datetime(st.st_mtime))

            

Reported by Pylint.

Parameters differ from overridden 'writestr' method
Error

Line: 140 Column: 5

                      zinfo.compress_type = compress_type or self.compression
        self.writestr(zinfo, data, compress_type)

    def writestr(self, zinfo_or_arcname, bytes, compress_type=None):
        ZipFile.writestr(self, zinfo_or_arcname, bytes, compress_type)
        fname = (zinfo_or_arcname.filename if isinstance(zinfo_or_arcname, ZipInfo)
                 else zinfo_or_arcname)
        logger.info("adding '%s'", fname)
        if fname != self.record_path:

            

Reported by Pylint.

Redefining built-in 'bytes'
Error

Line: 140 Column: 42

                      zinfo.compress_type = compress_type or self.compression
        self.writestr(zinfo, data, compress_type)

    def writestr(self, zinfo_or_arcname, bytes, compress_type=None):
        ZipFile.writestr(self, zinfo_or_arcname, bytes, compress_type)
        fname = (zinfo_or_arcname.filename if isinstance(zinfo_or_arcname, ZipInfo)
                 else zinfo_or_arcname)
        logger.info("adding '%s'", fname)
        if fname != self.record_path:

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import print_function

import csv
import hashlib
import os.path
import re
import stat
import time
from collections import OrderedDict

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/chardet/mbcharsetprober.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState


class MultiByteCharSetProber(CharSetProber):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              ######################### END LICENSE BLOCK #########################

from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState


class MultiByteCharSetProber(CharSetProber):
    """
    MultiByteCharSetProber

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 67 Column: 17

                          if coding_state == MachineState.ERROR:
                self.logger.debug('%s %s prober hit error at byte %s',
                                  self.charset_name, self.language, i)
                self._state = ProbingState.NOT_ME
                break
            elif coding_state == MachineState.ITS_ME:
                self._state = ProbingState.FOUND_IT
                break
            elif coding_state == MachineState.START:

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 70 Column: 17

                              self._state = ProbingState.NOT_ME
                break
            elif coding_state == MachineState.ITS_ME:
                self._state = ProbingState.FOUND_IT
                break
            elif coding_state == MachineState.START:
                char_len = self.coding_sm.get_current_charlen()
                if i == 0:
                    self._last_char[1] = byte_str[0]

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 86 Column: 17

                      if self.state == ProbingState.DETECTING:
            if (self.distribution_analyzer.got_enough_data() and
                    (self.get_confidence() > self.SHORTCUT_THRESHOLD)):
                self._state = ProbingState.FOUND_IT

        return self.state

    def get_confidence(self):
        return self.distribution_analyzer.get_confidence()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 40 Column: 9

                  """

    def __init__(self, lang_filter=None):
        super(MultiByteCharSetProber, self).__init__(lang_filter=lang_filter)
        self.distribution_analyzer = None
        self.coding_sm = None
        self._last_char = [0, 0]

    def reset(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                      self.coding_sm = None
        self._last_char = [0, 0]

    def reset(self):
        super(MultiByteCharSetProber, self).reset()
        if self.coding_sm:
            self.coding_sm.reset()
        if self.distribution_analyzer:
            self.distribution_analyzer.reset()

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 46 Column: 9

                      self._last_char = [0, 0]

    def reset(self):
        super(MultiByteCharSetProber, self).reset()
        if self.coding_sm:
            self.coding_sm.reset()
        if self.distribution_analyzer:
            self.distribution_analyzer.reset()
        self._last_char = [0, 0]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 54 Column: 5

                      self._last_char = [0, 0]

    @property
    def charset_name(self):
        raise NotImplementedError

    @property
    def language(self):
        raise NotImplementedError

            

Reported by Pylint.

pipenv/vendor/chardet/charsetgroupprober.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .enums import ProbingState
from .charsetprober import CharSetProber


class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              ######################### END LICENSE BLOCK #########################

from .enums import ProbingState
from .charsetprober import CharSetProber


class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):
        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 76 Column: 17

                              continue
            if state == ProbingState.FOUND_IT:
                self._best_guess_prober = prober
                self._state = ProbingState.FOUND_IT
                return self.state
            elif state == ProbingState.NOT_ME:
                prober.active = False
                self._active_num -= 1
                if self._active_num <= 0:

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 82 Column: 21

                              prober.active = False
                self._active_num -= 1
                if self._active_num <= 0:
                    self._state = ProbingState.NOT_ME
                    return self.state
        return self.state

    def get_confidence(self):
        state = self.state

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

Missing class docstring
Error

Line: 32 Column: 1

              from .charsetprober import CharSetProber


class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):
        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)
        self._active_num = 0
        self.probers = []
        self._best_guess_prober = None

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 34 Column: 9

              
class CharSetGroupProber(CharSetProber):
    def __init__(self, lang_filter=None):
        super(CharSetGroupProber, self).__init__(lang_filter=lang_filter)
        self._active_num = 0
        self.probers = []
        self._best_guess_prober = None

    def reset(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

                      self.probers = []
        self._best_guess_prober = None

    def reset(self):
        super(CharSetGroupProber, self).reset()
        self._active_num = 0
        for prober in self.probers:
            if prober:
                prober.reset()

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 40 Column: 9

                      self._best_guess_prober = None

    def reset(self):
        super(CharSetGroupProber, self).reset()
        self._active_num = 0
        for prober in self.probers:
            if prober:
                prober.reset()
                prober.active = True

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 50 Column: 5

                      self._best_guess_prober = None

    @property
    def charset_name(self):
        if not self._best_guess_prober:
            self.get_confidence()
            if not self._best_guess_prober:
                return None
        return self._best_guess_prober.charset_name

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/urllib3/util/url.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              import re
from collections import namedtuple

from ..exceptions import LocationParseError
from ..packages import six


url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from collections import namedtuple

from ..exceptions import LocationParseError
from ..packages import six


url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]

# We only want to normalize urls with an HTTP(S) scheme.

            

Reported by Pylint.

TODO: Remove this when we break backwards compatibility.
Error

Line: 403 Column: 3

                  # For the sake of backwards compatibility we put empty
    # string values for path if there are any defined values
    # beyond the path in the URL.
    # TODO: Remove this when we break backwards compatibility.
    if not path:
        if query is not None or fragment is not None:
            path = ""
        else:
            path = None

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import
import re
from collections import namedtuple

from ..exceptions import LocationParseError
from ..packages import six


url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]

            

Reported by Pylint.

Too many arguments (8/5)
Error

Line: 91 Column: 5

              
    __slots__ = ()

    def __new__(
        cls,
        scheme=None,
        auth=None,
        host=None,
        port=None,

            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 175 Column: 1

                      return self.url


def split_first(s, delims):
    """
    .. deprecated:: 1.25

    Given a string and an iterable of delimiters, split on the first found
    delimiter. Return two split parts and the matched delimiter.

            

Reported by Pylint.

Variable name "d" doesn't conform to snake_case naming style
Error

Line: 195 Column: 9

                  """
    min_idx = None
    min_delim = None
    for d in delims:
        idx = s.find(d)
        if idx < 0:
            continue

        if min_idx is None or idx < min_idx:

            

Reported by Pylint.

Unnecessary "elif" after "continue"
Error

Line: 254 Column: 9

              
    for segment in segments:
        # '.' is the current directory, so ignore it, it is superfluous
        if segment == ".":
            continue
        # Anything other than '..', should be appended to the output
        elif segment != "..":
            output.append(segment)
        # In this case segment == '..', if we can, we should pop the last

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 286 Column: 17

                          is_ipv6 = IPV6_ADDRZ_RE.match(host)
            if is_ipv6:
                match = ZONE_ID_RE.search(host)
                if match:
                    start, end = match.span(1)
                    zone_id = host[start:end]

                    if zone_id.startswith("%25") and zone_id != "%25":
                        zone_id = zone_id[3:]

            

Reported by Pylint.

Use a generator instead 'any(ord(x) > 128 for x in name)'
Error

Line: 306 Column: 17

              

def _idna_encode(name):
    if name and any([ord(x) > 128 for x in name]):
        try:
            from pipenv.patched.notpip._vendor import idna
        except ImportError:
            six.raise_from(
                LocationParseError("Unable to parse URL without the 'idna' module"),

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/urllib3/util/retry.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import email
import re

from ..exceptions import (
    ConnectTimeoutError,
    MaxRetryError,
    ProtocolError,
    ReadTimeoutError,
    ResponseError,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

                  ResponseError,
    InvalidHeader,
)
from ..packages import six


log = logging.getLogger(__name__)



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import
import time
import logging
from collections import namedtuple
from itertools import takewhile
import email
import re

from ..exceptions import (

            

Reported by Pylint.

Too many instance attributes (13/7)
Error

Line: 29 Column: 1

              )


class Retry(object):
    """ Retry configuration.

    Each retry attempt will create a new Retry object with updated values, so
    they can be safely reused.


            

Reported by Pylint.

Class 'Retry' inherits from object, can be safely removed from bases in python3
Error

Line: 29 Column: 1

              )


class Retry(object):
    """ Retry configuration.

    Each retry attempt will create a new Retry object with updated values, so
    they can be safely reused.


            

Reported by Pylint.

Too many arguments (14/5)
Error

Line: 161 Column: 5

                  #: Maximum backoff time.
    BACKOFF_MAX = 120

    def __init__(
        self,
        total=10,
        connect=None,
        read=None,
        redirect=None,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 199 Column: 5

                          [h.lower() for h in remove_headers_on_redirect]
        )

    def new(self, **kw):
        params = dict(
            total=self.total,
            connect=self.connect,
            read=self.read,
            redirect=self.redirect,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 249 Column: 5

                      backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1))
        return min(self.BACKOFF_MAX, backoff_value)

    def parse_retry_after(self, retry_after):
        # Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4
        if re.match(r"^\s*[0-9]+\s*$", retry_after):
            seconds = int(retry_after)
        else:
            retry_date_tuple = email.utils.parsedate(retry_after)

            

Reported by Pylint.

Method could be a function
Error

Line: 249 Column: 5

                      backoff_value = self.backoff_factor * (2 ** (consecutive_errors_len - 1))
        return min(self.BACKOFF_MAX, backoff_value)

    def parse_retry_after(self, retry_after):
        # Whitespace: https://tools.ietf.org/html/rfc7230#section-3.2.4
        if re.match(r"^\s*[0-9]+\s*$", retry_after):
            seconds = int(retry_after)
        else:
            retry_date_tuple = email.utils.parsedate(retry_after)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 275 Column: 5

              
        return self.parse_retry_after(retry_after)

    def sleep_for_retry(self, response=None):
        retry_after = self.get_retry_after(response)
        if retry_after:
            time.sleep(retry_after)
            return True


            

Reported by Pylint.

pipenv/patched/notpip/_vendor/urllib3/contrib/ntlmpool.py
15 issues
Unable to import 'ntlm'
Error

Line: 9 Column: 1

              from __future__ import absolute_import

from logging import getLogger
from ntlm import ntlm

from .. import HTTPSConnectionPool
from ..packages.six.moves.http_client import HTTPSConnection



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              from logging import getLogger
from ntlm import ntlm

from .. import HTTPSConnectionPool
from ..packages.six.moves.http_client import HTTPSConnection


log = getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from ntlm import ntlm

from .. import HTTPSConnectionPool
from ..packages.six.moves.http_client import HTTPSConnection


log = getLogger(__name__)



            

Reported by Pylint.

Instance of 'NTLMConnectionPool' has no 'num_connections' member
Error

Line: 42 Column: 9

                  def _new_conn(self):
        # Performs the NTLM handshake that secures the connection. The socket
        # must be kept open while requests are performed.
        self.num_connections += 1
        log.debug(
            "Starting NTLM HTTPS connection no. %d: https://%s%s",
            self.num_connections,
            self.host,
            self.authurl,

            

Reported by Pylint.

Instance of 'NTLMConnectionPool' has no 'num_connections' member
Error

Line: 45 Column: 13

                      self.num_connections += 1
        log.debug(
            "Starting NTLM HTTPS connection no. %d: https://%s%s",
            self.num_connections,
            self.host,
            self.authurl,
        )

        headers = {"Connection": "Keep-Alive"}

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 18 Column: 1

              log = getLogger(__name__)


class NTLMConnectionPool(HTTPSConnectionPool):
    """
    Implements an NTLM authentication version of an urllib3 connection pool
    """

    scheme = "https"

            

Reported by Pylint.

Argument name "pw" doesn't conform to snake_case naming style
Error

Line: 25 Column: 5

              
    scheme = "https"

    def __init__(self, user, pw, authurl, *args, **kwargs):
        """
        authurl is a random URL on the server that is protected by NTLM.
        user is the Windows user, probably in the DOMAIN\\username format.
        pw is the password for the user.
        """

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 31 Column: 9

                      user is the Windows user, probably in the DOMAIN\\username format.
        pw is the password for the user.
        """
        super(NTLMConnectionPool, self).__init__(*args, **kwargs)
        self.authurl = authurl
        self.rawuser = user
        user_parts = user.split("\\", 1)
        self.domain = user_parts[0].upper()
        self.user = user_parts[1]

            

Reported by Pylint.

Attribute name "pw" doesn't conform to snake_case naming style
Error

Line: 37 Column: 9

                      user_parts = user.split("\\", 1)
        self.domain = user_parts[0].upper()
        self.user = user_parts[1]
        self.pw = pw

    def _new_conn(self):
        # Performs the NTLM handshake that secures the connection. The socket
        # must be kept open while requests are performed.
        self.num_connections += 1

            

Reported by Pylint.

Variable name "s" doesn't conform to snake_case naming style
Error

Line: 75 Column: 13

                      # Server should respond with a challenge message
        auth_header_values = reshdr[resp_header].split(", ")
        auth_header_value = None
        for s in auth_header_values:
            if s[:5] == "NTLM ":
                auth_header_value = s[5:]
        if auth_header_value is None:
            raise Exception(
                "Unexpected %s response header: %s" % (resp_header, reshdr[resp_header])

            

Reported by Pylint.

pipenv/vendor/pep517/compat.py
15 issues
Unable to import 'tomli'
Error

Line: 41 Column: 5

                  from toml import load as toml_load  # noqa: F401
    from toml import TomlDecodeError as TOMLDecodeError  # noqa: F401
else:
    from tomli import load as toml_load  # noqa: F401
    from tomli import TOMLDecodeError  # noqa: F401

            

Reported by Pylint.

Unable to import 'tomli'
Error

Line: 42 Column: 5

                  from toml import TomlDecodeError as TOMLDecodeError  # noqa: F401
else:
    from tomli import load as toml_load  # noqa: F401
    from tomli import TOMLDecodeError  # noqa: F401

            

Reported by Pylint.

Redefining built-in 'FileNotFoundError'
Error

Line: 32 Column: 5

              # FileNotFoundError

try:
    FileNotFoundError = FileNotFoundError
except NameError:
    FileNotFoundError = IOError


if sys.version_info < (3, 6):

            

Reported by Pylint.

Assigning the same variable 'FileNotFoundError' to itself
Error

Line: 32 Column: 5

              # FileNotFoundError

try:
    FileNotFoundError = FileNotFoundError
except NameError:
    FileNotFoundError = IOError


if sys.version_info < (3, 6):

            

Reported by Pylint.

Unused load imported from toml as toml_load
Error

Line: 38 Column: 5

              

if sys.version_info < (3, 6):
    from toml import load as toml_load  # noqa: F401
    from toml import TomlDecodeError as TOMLDecodeError  # noqa: F401
else:
    from tomli import load as toml_load  # noqa: F401
    from tomli import TOMLDecodeError  # noqa: F401

            

Reported by Pylint.

Unused TomlDecodeError imported from toml as TOMLDecodeError
Error

Line: 39 Column: 5

              
if sys.version_info < (3, 6):
    from toml import load as toml_load  # noqa: F401
    from toml import TomlDecodeError as TOMLDecodeError  # noqa: F401
else:
    from tomli import load as toml_load  # noqa: F401
    from tomli import TOMLDecodeError  # noqa: F401

            

Reported by Pylint.

Unused TOMLDecodeError imported from tomli
Error

Line: 42 Column: 5

                  from toml import TomlDecodeError as TOMLDecodeError  # noqa: F401
else:
    from tomli import load as toml_load  # noqa: F401
    from tomli import TOMLDecodeError  # noqa: F401

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 10 Column: 5

              
if sys.version_info[0] >= 3:
    # Python 3
    def write_json(obj, path, **kwargs):
        with open(path, 'w', encoding='utf-8') as f:
            json.dump(obj, f, **kwargs)

    def read_json(path):
        with open(path, 'r', encoding='utf-8') as f:

            

Reported by Pylint.

Variable name "f" doesn't conform to snake_case naming style
Error

Line: 11 Column: 51

              if sys.version_info[0] >= 3:
    # Python 3
    def write_json(obj, path, **kwargs):
        with open(path, 'w', encoding='utf-8') as f:
            json.dump(obj, f, **kwargs)

    def read_json(path):
        with open(path, 'r', encoding='utf-8') as f:
            return json.load(f)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 14 Column: 5

                      with open(path, 'w', encoding='utf-8') as f:
            json.dump(obj, f, **kwargs)

    def read_json(path):
        with open(path, 'r', encoding='utf-8') as f:
            return json.load(f)

else:
    # Python 2

            

Reported by Pylint.

pipenv/vendor/chardet/mbcharsetprober.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              # 02110-1301  USA
######################### END LICENSE BLOCK #########################

from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState


class MultiByteCharSetProber(CharSetProber):
    """

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              ######################### END LICENSE BLOCK #########################

from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState


class MultiByteCharSetProber(CharSetProber):
    """
    MultiByteCharSetProber

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 67 Column: 17

                          if coding_state == MachineState.ERROR:
                self.logger.debug('%s %s prober hit error at byte %s',
                                  self.charset_name, self.language, i)
                self._state = ProbingState.NOT_ME
                break
            elif coding_state == MachineState.ITS_ME:
                self._state = ProbingState.FOUND_IT
                break
            elif coding_state == MachineState.START:

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 70 Column: 17

                              self._state = ProbingState.NOT_ME
                break
            elif coding_state == MachineState.ITS_ME:
                self._state = ProbingState.FOUND_IT
                break
            elif coding_state == MachineState.START:
                char_len = self.coding_sm.get_current_charlen()
                if i == 0:
                    self._last_char[1] = byte_str[0]

            

Reported by Pylint.

Attribute '_state' defined outside __init__
Error

Line: 86 Column: 17

                      if self.state == ProbingState.DETECTING:
            if (self.distribution_analyzer.got_enough_data() and
                    (self.get_confidence() > self.SHORTCUT_THRESHOLD)):
                self._state = ProbingState.FOUND_IT

        return self.state

    def get_confidence(self):
        return self.distribution_analyzer.get_confidence()

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 40 Column: 9

                  """

    def __init__(self, lang_filter=None):
        super(MultiByteCharSetProber, self).__init__(lang_filter=lang_filter)
        self.distribution_analyzer = None
        self.coding_sm = None
        self._last_char = [0, 0]

    def reset(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                      self.coding_sm = None
        self._last_char = [0, 0]

    def reset(self):
        super(MultiByteCharSetProber, self).reset()
        if self.coding_sm:
            self.coding_sm.reset()
        if self.distribution_analyzer:
            self.distribution_analyzer.reset()

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 46 Column: 9

                      self._last_char = [0, 0]

    def reset(self):
        super(MultiByteCharSetProber, self).reset()
        if self.coding_sm:
            self.coding_sm.reset()
        if self.distribution_analyzer:
            self.distribution_analyzer.reset()
        self._last_char = [0, 0]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 54 Column: 5

                      self._last_char = [0, 0]

    @property
    def charset_name(self):
        raise NotImplementedError

    @property
    def language(self):
        raise NotImplementedError

            

Reported by Pylint.

pipenv/vendor/urllib3/util/url.py
15 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              import re
from collections import namedtuple

from ..exceptions import LocationParseError
from ..packages import six

url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]

# We only want to normalize urls with an HTTP(S) scheme.

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              from collections import namedtuple

from ..exceptions import LocationParseError
from ..packages import six

url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]

# We only want to normalize urls with an HTTP(S) scheme.
# urllib3 infers URLs without a scheme (None) to be http.

            

Reported by Pylint.

TODO: Remove this when we break backwards compatibility.
Error

Line: 399 Column: 3

                  # For the sake of backwards compatibility we put empty
    # string values for path if there are any defined values
    # beyond the path in the URL.
    # TODO: Remove this when we break backwards compatibility.
    if not path:
        if query is not None or fragment is not None:
            path = ""
        else:
            path = None

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

import re
from collections import namedtuple

from ..exceptions import LocationParseError
from ..packages import six

url_attrs = ["scheme", "auth", "host", "port", "path", "query", "fragment"]

            

Reported by Pylint.

Too many arguments (8/5)
Error

Line: 91 Column: 5

              
    __slots__ = ()

    def __new__(
        cls,
        scheme=None,
        auth=None,
        host=None,
        port=None,

            

Reported by Pylint.

Argument name "s" doesn't conform to snake_case naming style
Error

Line: 175 Column: 1

                      return self.url


def split_first(s, delims):
    """
    .. deprecated:: 1.25

    Given a string and an iterable of delimiters, split on the first found
    delimiter. Return two split parts and the matched delimiter.

            

Reported by Pylint.

Variable name "d" doesn't conform to snake_case naming style
Error

Line: 195 Column: 9

                  """
    min_idx = None
    min_delim = None
    for d in delims:
        idx = s.find(d)
        if idx < 0:
            continue

        if min_idx is None or idx < min_idx:

            

Reported by Pylint.

Unnecessary "elif" after "continue"
Error

Line: 251 Column: 9

              
    for segment in segments:
        # '.' is the current directory, so ignore it, it is superfluous
        if segment == ".":
            continue
        # Anything other than '..', should be appended to the output
        elif segment != "..":
            output.append(segment)
        # In this case segment == '..', if we can, we should pop the last

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 283 Column: 17

                          is_ipv6 = IPV6_ADDRZ_RE.match(host)
            if is_ipv6:
                match = ZONE_ID_RE.search(host)
                if match:
                    start, end = match.span(1)
                    zone_id = host[start:end]

                    if zone_id.startswith("%25") and zone_id != "%25":
                        zone_id = zone_id[3:]

            

Reported by Pylint.

Use a generator instead 'any(ord(x) > 128 for x in name)'
Error

Line: 303 Column: 17

              

def _idna_encode(name):
    if name and any([ord(x) > 128 for x in name]):
        try:
            import idna
        except ImportError:
            six.raise_from(
                LocationParseError("Unable to parse URL without the 'idna' module"),

            

Reported by Pylint.