The following issues were found

pipenv/patched/notpip/_vendor/urllib3/request.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from __future__ import absolute_import

from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode


__all__ = ["RequestMethods"]



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from __future__ import absolute_import

from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode


__all__ = ["RequestMethods"]



            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode


__all__ = ["RequestMethods"]



            

Reported by Pylint.

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

Line: 10 Column: 1

              __all__ = ["RequestMethods"]


class RequestMethods(object):
    """
    Convenience mixin for classes who implement a :meth:`urlopen` method, such
    as :class:`~urllib3.connectionpool.HTTPConnectionPool` and
    :class:`~urllib3.poolmanager.PoolManager`.


            

Reported by Pylint.

Too many arguments (7/5)
Error

Line: 44 Column: 5

                  def __init__(self, headers=None):
        self.headers = headers or {}

    def urlopen(
        self,
        method,
        url,
        body=None,
        headers=None,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 44 Column: 5

                  def __init__(self, headers=None):
        self.headers = headers or {}

    def urlopen(
        self,
        method,
        url,
        body=None,
        headers=None,

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 74 Column: 9

              
        urlopen_kw["request_url"] = url

        if method in self._encode_url_methods:
            return self.request_encode_url(
                method, url, fields=fields, headers=headers, **urlopen_kw
            )
        else:
            return self.request_encode_body(

            

Reported by Pylint.

Too many arguments (7/5)
Error

Line: 99 Column: 5

              
        return self.urlopen(method, url, **extra_kw)

    def request_encode_body(
        self,
        method,
        url,
        fields=None,
        headers=None,

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/urllib3/packages/ssl_match_hostname/_implementation.py
8 issues
Undefined variable 'unicode'
Error

Line: 81 Column: 15

              
def _to_unicode(obj):
    if isinstance(obj, str) and sys.version_info < (3,):
        obj = unicode(obj, encoding="ascii", errors="strict")
    return obj


def _ipaddress_match(ipname, host_ip):
    """Exact matching of IP addresses.

            

Reported by Pylint.

Bad except clauses order (ValueError is an ancestor class of UnicodeError)
Error

Line: 117 Column: 12

                  except ValueError:
        # Not an IP address (common case)
        host_ip = None
    except UnicodeError:
        # Divergence from upstream: Have to deal with ipaddress not taking
        # byte strings.  addresses should be all ascii, so we consider it not
        # an ipaddress in this case
        host_ip = None
    except AttributeError:

            

Reported by Pylint.

XXX according to RFC 2818, the most specific Common Name
Error

Line: 144 Column: 3

                      # in subjectAltName
        for sub in cert.get("subject", ()):
            for key, value in sub:
                # XXX according to RFC 2818, the most specific Common Name
                # must be used.
                if key == "commonName":
                    if _dnsname_match(value, hostname):
                        return
                    dnsnames.append(value)

            

Reported by Pylint.

Missing class docstring
Error

Line: 21 Column: 1

              __version__ = "3.5.0.1"


class CertificateError(ValueError):
    pass


def _dnsname_match(dn, hostname, max_wildcards=1):
    """Matching according to RFC 6125, section 6.4.3

            

Reported by Pylint.

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

Line: 25 Column: 1

                  pass


def _dnsname_match(dn, hostname, max_wildcards=1):
    """Matching according to RFC 6125, section 6.4.3

    http://tools.ietf.org/html/rfc6125#section-6.4.3
    """
    pats = []

            

Reported by Pylint.

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

Line: 93 Column: 5

                  """
    # OpenSSL may add a trailing newline to a subjectAltName's IP address
    # Divergence from upstream: ipaddress can't handle byte str
    ip = ipaddress.ip_address(_to_unicode(ipname).rstrip())
    return ip == host_ip


def match_hostname(cert, hostname):
    """Verify that *cert* (in decoded format as returned by

            

Reported by Pylint.

Too many branches (19/12)
Error

Line: 97 Column: 1

                  return ip == host_ip


def match_hostname(cert, hostname):
    """Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed, but IP addresses are not accepted for *hostname*.

    CertificateError is raised on failure. On success, the function

            

Reported by Pylint.

Unnecessary "elif" after "raise"
Error

Line: 150 Column: 5

                                  if _dnsname_match(value, hostname):
                        return
                    dnsnames.append(value)
    if len(dnsnames) > 1:
        raise CertificateError(
            "hostname %r "
            "doesn't match either of %s" % (hostname, ", ".join(map(repr, dnsnames)))
        )
    elif len(dnsnames) == 1:

            

Reported by Pylint.

pipenv/cmdparse.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              import itertools
import re
import shlex


class ScriptEmptyError(ValueError):
    pass



            

Reported by Pylint.

Missing class docstring
Error

Line: 6 Column: 1

              import shlex


class ScriptEmptyError(ValueError):
    pass


def _quote_if_contains(value, pattern):
    if next(iter(re.finditer(pattern, value)), None):

            

Reported by Pylint.

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

Line: 16 Column: 1

                  return value


class Script(object):
    """Parse a script line (in Pipfile's [scripts] section).

    This always works in POSIX mode, even on Windows.
    """


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 28 Column: 5

                          self._parts.extend(args)

    @classmethod
    def parse(cls, value):
        if isinstance(value, str):
            value = shlex.split(value)
        if not value:
            raise ScriptEmptyError(value)
        return cls(value[0], value[1:])

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 39 Column: 5

                      return "Script({0!r})".format(self._parts)

    @property
    def command(self):
        return self._parts[0]

    @property
    def args(self):
        return self._parts[1:]

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 43 Column: 5

                      return self._parts[0]

    @property
    def args(self):
        return self._parts[1:]

    @property
    def cmd_args(self):
        return self._parts

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 47 Column: 5

                      return self._parts[1:]

    @property
    def cmd_args(self):
        return self._parts

    def extend(self, extra_args):
        self._parts.extend(extra_args)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 50 Column: 5

                  def cmd_args(self):
        return self._parts

    def extend(self, extra_args):
        self._parts.extend(extra_args)

    def cmdify(self):
        """Encode into a cmd-executable string.


            

Reported by Pylint.

pipenv/vendor/markupsafe/_native.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              import typing as t

from . import Markup


def escape(s: t.Any) -> Markup:
    """Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
    the string with HTML-safe sequences. Use this if you need to display
    text that might contain such characters in HTML.

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import typing as t

from . import Markup


def escape(s: t.Any) -> Markup:
    """Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
    the string with HTML-safe sequences. Use this if you need to display
    text that might contain such characters in HTML.

            

Reported by Pylint.

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

Line: 6 Column: 1

              from . import Markup


def escape(s: t.Any) -> Markup:
    """Replace the characters ``&``, ``<``, ``>``, ``'``, and ``"`` in
    the string with HTML-safe sequences. Use this if you need to display
    text that might contain such characters in HTML.

    If the object has an ``__html__`` method, it is called and the

            

Reported by Pylint.

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

Line: 30 Column: 1

                  )


def escape_silent(s: t.Optional[t.Any]) -> Markup:
    """Like :func:`escape` but treats ``None`` as the empty string.
    Useful with optional values, as otherwise you get the string
    ``'None'`` when the value is ``None``.

    >>> escape(None)

            

Reported by Pylint.

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

Line: 46 Column: 1

                  return escape(s)


def soft_str(s: t.Any) -> str:
    """Convert an object to a string if it isn't already. This preserves
    a :class:`Markup` string rather than converting it back to a basic
    string, so it will still be marked as safe and won't be escaped
    again.


            

Reported by Pylint.

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

Line: 66 Column: 1

                  return s


def soft_unicode(s: t.Any) -> str:
    import warnings

    warnings.warn(
        "'soft_unicode' has been renamed to 'soft_str'. The old name"
        " will be removed in MarkupSafe 2.1.",

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 66 Column: 1

                  return s


def soft_unicode(s: t.Any) -> str:
    import warnings

    warnings.warn(
        "'soft_unicode' has been renamed to 'soft_str'. The old name"
        " will be removed in MarkupSafe 2.1.",

            

Reported by Pylint.

Import outside toplevel (warnings)
Error

Line: 67 Column: 5

              

def soft_unicode(s: t.Any) -> str:
    import warnings

    warnings.warn(
        "'soft_unicode' has been renamed to 'soft_str'. The old name"
        " will be removed in MarkupSafe 2.1.",
        DeprecationWarning,

            

Reported by Pylint.

pipenv/vendor/jinja2/visitor.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              """
import typing as t

from .nodes import Node

if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):

            

Reported by Pylint.

Unable to import 'typing_extensions'
Error

Line: 9 Column: 5

              from .nodes import Node

if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):
        def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
            ...


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 11 Column: 5

              if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):
        def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
            ...


class NodeVisitor:

            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 5

              if t.TYPE_CHECKING:
    import typing_extensions as te

    class VisitCallable(te.Protocol):
        def __call__(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
            ...


class NodeVisitor:

            

Reported by Pylint.

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

Line: 37 Column: 9

              
    def visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
        """Visit a node."""
        f = self.get_visitor(node)

        if f is not None:
            return f(node, *args, **kwargs)

        return self.generic_visit(node, *args, **kwargs)

            

Reported by Pylint.

Redefining argument with the local name 'node'
Error

Line: 46 Column: 13

              
    def generic_visit(self, node: Node, *args: t.Any, **kwargs: t.Any) -> t.Any:
        """Called if no explicit visitor function exists for a node."""
        for node in node.iter_child_nodes():
            self.visit(node, *args, **kwargs)


class NodeTransformer(NodeVisitor):
    """Walks the abstract syntax tree and allows modifications of nodes.

            

Reported by Pylint.

Unnecessary "elif" after "continue"
Error

Line: 68 Column: 25

                              for value in old_value:
                    if isinstance(value, Node):
                        value = self.visit(value, *args, **kwargs)
                        if value is None:
                            continue
                        elif not isinstance(value, Node):
                            new_values.extend(value)
                            continue
                    new_values.append(value)

            

Reported by Pylint.

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

Line: 87 Column: 9

                      """As transformers may return lists in some places this method
        can be used to enforce a list as return value.
        """
        rv = self.visit(node, *args, **kwargs)

        if not isinstance(rv, list):
            return [rv]

        return rv

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/requests/api.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              :license: Apache2, see LICENSE for more details.
"""

from . import sessions


def request(method, url, **kwargs):
    """Constructs and sends a :class:`Request <Request>`.


            

Reported by Pylint.

Line too long (106/100)
Error

Line: 25 Column: 1

                      in the query string for the :class:`Request`.
    :param data: (optional) Dictionary, list of tuples, bytes, or file-like
        object to send in the body of the :class:`Request`.
    :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.
    :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
    :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
    :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
        ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
        or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string

            

Reported by Pylint.

Line too long (133/100)
Error

Line: 28 Column: 1

                  :param json: (optional) A JSON serializable Python object to send in the body of the :class:`Request`.
    :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
    :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
    :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
        ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
        or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string
        defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers
        to add for the file.
    :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.

            

Reported by Pylint.

Line too long (116/100)
Error

Line: 29 Column: 1

                  :param headers: (optional) Dictionary of HTTP Headers to send with the :class:`Request`.
    :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
    :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
        ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
        or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string
        defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers
        to add for the file.
    :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
    :param timeout: (optional) How many seconds to wait for the server to send data

            

Reported by Pylint.

Line too long (116/100)
Error

Line: 30 Column: 1

                  :param cookies: (optional) Dict or CookieJar object to send with the :class:`Request`.
    :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
        ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
        or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string
        defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers
        to add for the file.
    :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
    :param timeout: (optional) How many seconds to wait for the server to send data
        before giving up, as a float, or a :ref:`(connect timeout, read

            

Reported by Pylint.

Line too long (123/100)
Error

Line: 31 Column: 1

                  :param files: (optional) Dictionary of ``'name': file-like-objects`` (or ``{'name': file-tuple}``) for multipart encoding upload.
        ``file-tuple`` can be a 2-tuple ``('filename', fileobj)``, 3-tuple ``('filename', fileobj, 'content_type')``
        or a 4-tuple ``('filename', fileobj, 'content_type', custom_headers)``, where ``'content-type'`` is a string
        defining the content type of the given file and ``custom_headers`` a dict-like object containing additional headers
        to add for the file.
    :param auth: (optional) Auth tuple to enable Basic/Digest/Custom HTTP Auth.
    :param timeout: (optional) How many seconds to wait for the server to send data
        before giving up, as a float, or a :ref:`(connect timeout, read
        timeout) <timeouts>` tuple.

            

Reported by Pylint.

Line too long (136/100)
Error

Line: 38 Column: 1

                      before giving up, as a float, or a :ref:`(connect timeout, read
        timeout) <timeouts>` tuple.
    :type timeout: float or tuple
    :param allow_redirects: (optional) Boolean. Enable/disable GET/OPTIONS/POST/PUT/PATCH/DELETE/HEAD redirection. Defaults to ``True``.
    :type allow_redirects: bool
    :param proxies: (optional) Dictionary mapping protocol to the URL of the proxy.
    :param verify: (optional) Either a boolean, in which case it controls whether we verify
            the server's TLS certificate, or a string, in which case it must be a path
            to a CA bundle to use. Defaults to ``True``.

            

Reported by Pylint.

Line too long (107/100)
Error

Line: 45 Column: 1

                          the server's TLS certificate, or a string, in which case it must be a path
            to a CA bundle to use. Defaults to ``True``.
    :param stream: (optional) if ``False``, the response content will be immediately downloaded.
    :param cert: (optional) if String, path to ssl client cert file (.pem). If Tuple, ('cert', 'key') pair.
    :return: :class:`Response <Response>` object
    :rtype: requests.Response

    Usage::


            

Reported by Pylint.

pipenv/vendor/importlib_metadata/_adapters.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              import textwrap
import email.message

from ._text import FoldedCase


class Message(email.message.Message):
    multiple_use_keys = set(
        map(

            

Reported by Pylint.

Unused argument 'args'
Error

Line: 35 Column: 1

                      vars(res).update(vars(orig))
        return res

    def __init__(self, *args, **kwargs):
        self._headers = self._repair_headers()

    # suppress spurious error from mypy
    def __iter__(self):
        return super().__iter__()

            

Reported by Pylint.

__init__ method from base class 'Message' is not called
Error

Line: 35 Column: 5

                      vars(res).update(vars(orig))
        return res

    def __init__(self, *args, **kwargs):
        self._headers = self._repair_headers()

    # suppress spurious error from mypy
    def __iter__(self):
        return super().__iter__()

            

Reported by Pylint.

Unused argument 'kwargs'
Error

Line: 35 Column: 1

                      vars(res).update(vars(orig))
        return res

    def __init__(self, *args, **kwargs):
        self._headers = self._repair_headers()

    # suppress spurious error from mypy
    def __iter__(self):
        return super().__iter__()

            

Reported by Pylint.

Useless super delegation in method '__iter__'
Error

Line: 39 Column: 5

                      self._headers = self._repair_headers()

    # suppress spurious error from mypy
    def __iter__(self):
        return super().__iter__()

    def _repair_headers(self):
        def redent(value):
            "Correct for RFC822 indentation"

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import re
import textwrap
import email.message

from ._text import FoldedCase


class Message(email.message.Message):
    multiple_use_keys = set(

            

Reported by Pylint.

Missing class docstring
Error

Line: 8 Column: 1

              from ._text import FoldedCase


class Message(email.message.Message):
    multiple_use_keys = set(
        map(
            FoldedCase,
            [
                'Classifier',

            

Reported by Pylint.

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

Line: 65 Column: 13

                          value = self.get_all(key) if key in self.multiple_use_keys else self[key]
            if key == 'Keywords':
                value = re.split(r'\s+', value)
            tk = key.lower().replace('-', '_')
            return tk, value

        return dict(map(transform, map(FoldedCase, self)))

            

Reported by Pylint.

pipenv/vendor/jinja2/meta.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              """
import typing as t

from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame

if t.TYPE_CHECKING:
    from .environment import Environment

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              import typing as t

from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame

if t.TYPE_CHECKING:
    from .environment import Environment


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame

if t.TYPE_CHECKING:
    from .environment import Environment



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 5

              from .compiler import Frame

if t.TYPE_CHECKING:
    from .environment import Environment


class TrackingCodeGenerator(CodeGenerator):
    """We abuse the code generator for introspection."""


            

Reported by Pylint.

Unused Environment imported from environment
Error

Line: 11 Column: 5

              from .compiler import Frame

if t.TYPE_CHECKING:
    from .environment import Environment


class TrackingCodeGenerator(CodeGenerator):
    """We abuse the code generator for introspection."""


            

Reported by Pylint.

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

Line: 21 Column: 5

                      super().__init__(environment, "<introspection>", "<introspection>")
        self.undeclared_identifiers: t.Set[str] = set()

    def write(self, x: str) -> None:
        """Don't write."""

    def enter_frame(self, frame: Frame) -> None:
        """Remember all undeclared identifiers."""
        super().enter_frame(frame)

            

Reported by Pylint.

Too many branches (13/12)
Error

Line: 61 Column: 1

              _RefType = t.Union[nodes.Extends, nodes.FromImport, nodes.Import, nodes.Include]


def find_referenced_templates(ast: nodes.Template) -> t.Iterator[t.Optional[str]]:
    """Finds all the referenced templates from the AST.  This will return an
    iterator over all the hardcoded template extensions, inclusions and
    imports.  If dynamic inheritance or inclusion is used, `None` will be
    yielded.


            

Reported by Pylint.

Too many nested blocks (6/5)
Error

Line: 78 Column: 5

                  """
    template_name: t.Any

    for node in ast.find_all(_ref_types):
        template: nodes.Expr = node.template  # type: ignore

        if not isinstance(template, nodes.Const):
            # a tuple with some non consts in there
            if isinstance(template, (nodes.Tuple, nodes.List)):

            

Reported by Pylint.

pipenv/vendor/urllib3/request.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from __future__ import absolute_import

from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode

__all__ = ["RequestMethods"]


class RequestMethods(object):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from __future__ import absolute_import

from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode

__all__ = ["RequestMethods"]


class RequestMethods(object):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import

from .filepost import encode_multipart_formdata
from .packages.six.moves.urllib.parse import urlencode

__all__ = ["RequestMethods"]


class RequestMethods(object):

            

Reported by Pylint.

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

Line: 9 Column: 1

              __all__ = ["RequestMethods"]


class RequestMethods(object):
    """
    Convenience mixin for classes who implement a :meth:`urlopen` method, such
    as :class:`urllib3.HTTPConnectionPool` and
    :class:`urllib3.PoolManager`.


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 43 Column: 5

                  def __init__(self, headers=None):
        self.headers = headers or {}

    def urlopen(
        self,
        method,
        url,
        body=None,
        headers=None,

            

Reported by Pylint.

Too many arguments (7/5)
Error

Line: 43 Column: 5

                  def __init__(self, headers=None):
        self.headers = headers or {}

    def urlopen(
        self,
        method,
        url,
        body=None,
        headers=None,

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 73 Column: 9

              
        urlopen_kw["request_url"] = url

        if method in self._encode_url_methods:
            return self.request_encode_url(
                method, url, fields=fields, headers=headers, **urlopen_kw
            )
        else:
            return self.request_encode_body(

            

Reported by Pylint.

Too many arguments (7/5)
Error

Line: 98 Column: 5

              
        return self.urlopen(method, url, **extra_kw)

    def request_encode_body(
        self,
        method,
        url,
        fields=None,
        headers=None,

            

Reported by Pylint.

pipenv/vendor/urllib3/packages/ssl_match_hostname/_implementation.py
8 issues
Undefined variable 'unicode'
Error

Line: 81 Column: 15

              
def _to_unicode(obj):
    if isinstance(obj, str) and sys.version_info < (3,):
        obj = unicode(obj, encoding="ascii", errors="strict")
    return obj


def _ipaddress_match(ipname, host_ip):
    """Exact matching of IP addresses.

            

Reported by Pylint.

Bad except clauses order (ValueError is an ancestor class of UnicodeError)
Error

Line: 117 Column: 12

                  except ValueError:
        # Not an IP address (common case)
        host_ip = None
    except UnicodeError:
        # Divergence from upstream: Have to deal with ipaddress not taking
        # byte strings.  addresses should be all ascii, so we consider it not
        # an ipaddress in this case
        host_ip = None
    except AttributeError:

            

Reported by Pylint.

XXX according to RFC 2818, the most specific Common Name
Error

Line: 144 Column: 3

                      # in subjectAltName
        for sub in cert.get("subject", ()):
            for key, value in sub:
                # XXX according to RFC 2818, the most specific Common Name
                # must be used.
                if key == "commonName":
                    if _dnsname_match(value, hostname):
                        return
                    dnsnames.append(value)

            

Reported by Pylint.

Missing class docstring
Error

Line: 21 Column: 1

              __version__ = "3.5.0.1"


class CertificateError(ValueError):
    pass


def _dnsname_match(dn, hostname, max_wildcards=1):
    """Matching according to RFC 6125, section 6.4.3

            

Reported by Pylint.

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

Line: 25 Column: 1

                  pass


def _dnsname_match(dn, hostname, max_wildcards=1):
    """Matching according to RFC 6125, section 6.4.3

    http://tools.ietf.org/html/rfc6125#section-6.4.3
    """
    pats = []

            

Reported by Pylint.

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

Line: 93 Column: 5

                  """
    # OpenSSL may add a trailing newline to a subjectAltName's IP address
    # Divergence from upstream: ipaddress can't handle byte str
    ip = ipaddress.ip_address(_to_unicode(ipname).rstrip())
    return ip == host_ip


def match_hostname(cert, hostname):
    """Verify that *cert* (in decoded format as returned by

            

Reported by Pylint.

Too many branches (19/12)
Error

Line: 97 Column: 1

                  return ip == host_ip


def match_hostname(cert, hostname):
    """Verify that *cert* (in decoded format as returned by
    SSLSocket.getpeercert()) matches the *hostname*.  RFC 2818 and RFC 6125
    rules are followed, but IP addresses are not accepted for *hostname*.

    CertificateError is raised on failure. On success, the function

            

Reported by Pylint.

Unnecessary "elif" after "raise"
Error

Line: 150 Column: 5

                                  if _dnsname_match(value, hostname):
                        return
                    dnsnames.append(value)
    if len(dnsnames) > 1:
        raise CertificateError(
            "hostname %r "
            "doesn't match either of %s" % (hostname, ", ".join(map(repr, dnsnames)))
        )
    elif len(dnsnames) == 1:

            

Reported by Pylint.