The following issues were found

pipenv/vendor/requests/cookies.py
40 issues
Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              import time
import calendar

from ._internal_utils import to_native_string
from .compat import cookielib, urlparse, urlunparse, Morsel, MutableMapping

try:
    import threading
except ImportError:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              import calendar

from ._internal_utils import to_native_string
from .compat import cookielib, urlparse, urlunparse, Morsel, MutableMapping

try:
    import threading
except ImportError:
    import dummy_threading as threading

            

Reported by Pylint.

Access to a protected member _original_response of a client class
Error

Line: 126 Column: 13

                  :param response: urllib3.HTTPResponse object
    """
    if not (hasattr(response, '_original_response') and
            response._original_response):
        return
    # the _original_response field is the wrapped httplib.HTTPResponse object,
    req = MockRequest(request)
    # pull out the HTTPMessage with the headers and put it in the mock:
    res = MockResponse(response._original_response.msg)

            

Reported by Pylint.

Access to a protected member _original_response of a client class
Error

Line: 131 Column: 24

                  # the _original_response field is the wrapped httplib.HTTPResponse object,
    req = MockRequest(request)
    # pull out the HTTPMessage with the headers and put it in the mock:
    res = MockResponse(response._original_response.msg)
    jar.extract_cookies(res, req)


def get_cookie_header(jar, request):
    """

            

Reported by Pylint.

Attribute '_cookies_lock' defined outside __init__
Error

Line: 412 Column: 13

                      """Unlike a normal CookieJar, this class is pickleable."""
        self.__dict__.update(state)
        if '_cookies_lock' not in self.__dict__:
            self._cookies_lock = threading.RLock()

    def copy(self):
        """Return a copy of this RequestsCookieJar."""
        new_cj = RequestsCookieJar()
        new_cj.set_policy(self.get_policy())

            

Reported by Pylint.

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

Line: 485 Column: 13

                      try:
            expires = int(time.time() + int(morsel['max-age']))
        except ValueError:
            raise TypeError('max-age: %s must be integer' % morsel['max-age'])
    elif morsel['expires']:
        time_template = '%a, %d-%b-%Y %H:%M:%S GMT'
        expires = calendar.timegm(
            time.strptime(morsel['expires'], time_template)
        )

            

Reported by Pylint.

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

Line: 25 Column: 1

                  import dummy_threading as threading


class MockRequest(object):
    """Wraps a `requests.Request` to mimic a `urllib2.Request`.

    The code in `cookielib.CookieJar` expects this interface in order to correctly
    manage cookie policies, i.e., determine whether a cookie can be set, given the
    domains of the request and the cookie.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 42 Column: 5

                      self._new_headers = {}
        self.type = urlparse(self._r.url).scheme

    def get_type(self):
        return self.type

    def get_host(self):
        return urlparse(self._r.url).netloc


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                  def get_type(self):
        return self.type

    def get_host(self):
        return urlparse(self._r.url).netloc

    def get_origin_req_host(self):
        return self.get_host()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 48 Column: 5

                  def get_host(self):
        return urlparse(self._r.url).netloc

    def get_origin_req_host(self):
        return self.get_host()

    def get_full_url(self):
        # Only return the response's URL if the user hadn't set the Host
        # header

            

Reported by Pylint.

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

Line: 16 Column: 1

              import time
import calendar

from ._internal_utils import to_native_string
from .compat import cookielib, urlparse, urlunparse, Morsel, MutableMapping

try:
    import threading
except ImportError:

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              import calendar

from ._internal_utils import to_native_string
from .compat import cookielib, urlparse, urlunparse, Morsel, MutableMapping

try:
    import threading
except ImportError:
    import dummy_threading as threading

            

Reported by Pylint.

Access to a protected member _original_response of a client class
Error

Line: 126 Column: 13

                  :param response: urllib3.HTTPResponse object
    """
    if not (hasattr(response, '_original_response') and
            response._original_response):
        return
    # the _original_response field is the wrapped httplib.HTTPResponse object,
    req = MockRequest(request)
    # pull out the HTTPMessage with the headers and put it in the mock:
    res = MockResponse(response._original_response.msg)

            

Reported by Pylint.

Access to a protected member _original_response of a client class
Error

Line: 131 Column: 24

                  # the _original_response field is the wrapped httplib.HTTPResponse object,
    req = MockRequest(request)
    # pull out the HTTPMessage with the headers and put it in the mock:
    res = MockResponse(response._original_response.msg)
    jar.extract_cookies(res, req)


def get_cookie_header(jar, request):
    """

            

Reported by Pylint.

Attribute '_cookies_lock' defined outside __init__
Error

Line: 412 Column: 13

                      """Unlike a normal CookieJar, this class is pickleable."""
        self.__dict__.update(state)
        if '_cookies_lock' not in self.__dict__:
            self._cookies_lock = threading.RLock()

    def copy(self):
        """Return a copy of this RequestsCookieJar."""
        new_cj = RequestsCookieJar()
        new_cj.set_policy(self.get_policy())

            

Reported by Pylint.

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

Line: 485 Column: 13

                      try:
            expires = int(time.time() + int(morsel['max-age']))
        except ValueError:
            raise TypeError('max-age: %s must be integer' % morsel['max-age'])
    elif morsel['expires']:
        time_template = '%a, %d-%b-%Y %H:%M:%S GMT'
        expires = calendar.timegm(
            time.strptime(morsel['expires'], time_template)
        )

            

Reported by Pylint.

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

Line: 25 Column: 1

                  import dummy_threading as threading


class MockRequest(object):
    """Wraps a `requests.Request` to mimic a `urllib2.Request`.

    The code in `cookielib.CookieJar` expects this interface in order to correctly
    manage cookie policies, i.e., determine whether a cookie can be set, given the
    domains of the request and the cookie.

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 42 Column: 5

                      self._new_headers = {}
        self.type = urlparse(self._r.url).scheme

    def get_type(self):
        return self.type

    def get_host(self):
        return urlparse(self._r.url).netloc


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 45 Column: 5

                  def get_type(self):
        return self.type

    def get_host(self):
        return urlparse(self._r.url).netloc

    def get_origin_req_host(self):
        return self.get_host()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 48 Column: 5

                  def get_host(self):
        return urlparse(self._r.url).netloc

    def get_origin_req_host(self):
        return self.get_host()

    def get_full_url(self):
        # Only return the response's URL if the user hadn't set the Host
        # header

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/filters/optionaltags.py
40 issues
Attempted relative import beyond top-level package
Error

Line: 3 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from . import base


class Filter(base.Filter):
    """Removes optional tags from the token stream"""
    def slider(self):
        previous1 = previous2 = None

            

Reported by Pylint.

Redefining built-in 'next'
Error

Line: 19 Column: 30

                          yield previous2, previous1, None

    def __iter__(self):
        for previous, token, next in self.slider():
            type = token["type"]
            if type == "StartTag":
                if (token["data"] or
                        not self.is_optional_start(token["name"], previous, next)):
                    yield token

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 20 Column: 13

              
    def __iter__(self):
        for previous, token, next in self.slider():
            type = token["type"]
            if type == "StartTag":
                if (token["data"] or
                        not self.is_optional_start(token["name"], previous, next)):
                    yield token
            elif type == "EndTag":

            

Reported by Pylint.

Redefining built-in 'next'
Error

Line: 31 Column: 52

                          else:
                yield token

    def is_optional_start(self, tagname, previous, next):
        type = next and next["type"] or None
        if tagname in 'html':
            # An html element's start tag may be omitted if the first thing
            # inside the html element is not a space character or a comment.
            return type not in ("Comment", "SpaceCharacters")

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 32 Column: 9

                              yield token

    def is_optional_start(self, tagname, previous, next):
        type = next and next["type"] or None
        if tagname in 'html':
            # An html element's start tag may be omitted if the first thing
            # inside the html element is not a space character or a comment.
            return type not in ("Comment", "SpaceCharacters")
        elif tagname == 'head':

            

Reported by Pylint.

XXX: we also omit the start tag if the head element is empty
Error

Line: 40 Column: 3

                      elif tagname == 'head':
            # A head element's start tag may be omitted if the first thing
            # inside the head element is an element.
            # XXX: we also omit the start tag if the head element is empty
            if type in ("StartTag", "EmptyTag"):
                return True
            elif type == "EndTag":
                return next["name"] == "head"
        elif tagname == 'body':

            

Reported by Pylint.

XXX: we do not look at the preceding event, so we never omit
Error

Line: 54 Column: 3

                          if type in ("Comment", "SpaceCharacters"):
                return False
            elif type == "StartTag":
                # XXX: we do not look at the preceding event, so we never omit
                # the body element's start tag if it's followed by a script or
                # a style element.
                return next["name"] not in ('script', 'style')
            else:
                return True

            

Reported by Pylint.

XXX: we do not look at the preceding event, so instead we never
Error

Line: 66 Column: 3

                          # is not immediately preceded by another colgroup element whose
            # end tag has been omitted.
            if type in ("StartTag", "EmptyTag"):
                # XXX: we do not look at the preceding event, so instead we never
                # omit the colgroup element's end tag when it is immediately
                # followed by another colgroup element. See is_optional_end.
                return next["name"] == "col"
            else:
                return False

            

Reported by Pylint.

Redefining built-in 'next'
Error

Line: 88 Column: 40

                              return False
        return False

    def is_optional_end(self, tagname, next):
        type = next and next["type"] or None
        if tagname in ('html', 'head', 'body'):
            # An html element's end tag may be omitted if the html element
            # is not immediately followed by a space character or a comment.
            return type not in ("Comment", "SpaceCharacters")

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 89 Column: 9

                      return False

    def is_optional_end(self, tagname, next):
        type = next and next["type"] or None
        if tagname in ('html', 'head', 'body'):
            # An html element's end tag may be omitted if the html element
            # is not immediately followed by a space character or a comment.
            return type not in ("Comment", "SpaceCharacters")
        elif tagname in ('li', 'optgroup', 'tr'):

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/distlib/scripts.py
39 issues
Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              import struct
import sys

from .compat import sysconfig, detect_encoding, ZipFile
from .resources import finder
from .util import (FileOperator, get_export_entry, convert_path,
                   get_executable, in_venv)

logger = logging.getLogger(__name__)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              import sys

from .compat import sysconfig, detect_encoding, ZipFile
from .resources import finder
from .util import (FileOperator, get_export_entry, convert_path,
                   get_executable, in_venv)

logger = logging.getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              
from .compat import sysconfig, detect_encoding, ZipFile
from .resources import finder
from .util import (FileOperator, get_export_entry, convert_path,
                   get_executable, in_venv)

logger = logging.getLogger(__name__)

_DEFAULT_MANIFEST = '''

            

Reported by Pylint.

Module 'os' has no '_name' member; maybe '_names'?
Error

Line: 85 Column: 50

                      self.clobber = False
        # It only makes sense to set mode bits on POSIX.
        self.set_mode = (os.name == 'posix') or (os.name == 'java' and
                                                 os._name == 'posix')
        self.variants = set(('', 'X.Y'))
        self._fileop = fileop or FileOperator(dry_run)

        self._is_nt = os.name == 'nt' or (
            os.name == 'java' and os._name == 'nt')

            

Reported by Pylint.

Module 'os' has no '_name' member; maybe '_names'?
Error

Line: 90 Column: 35

                      self._fileop = fileop or FileOperator(dry_run)

        self._is_nt = os.name == 'nt' or (
            os.name == 'java' and os._name == 'nt')

    def _get_alternate_executable(self, executable, options):
        if options.get('gui', False) and self._is_nt:  # pragma: no cover
            dn, fn = os.path.split(executable)
            fn = fn.replace('python', 'pythonw')

            

Reported by Pylint.

Unable to import 'java'
Error

Line: 115 Column: 17

                      def _fix_jython_executable(self, executable):
            if self._is_shell(executable):
                # Workaround for Jython is not needed on Linux systems.
                import java

                if java.lang.System.getProperty('os.name') == 'Linux':
                    return executable
            elif executable.lower().endswith('jython.exe'):
                # Use wrapper exe for Jython on Windows

            

Reported by Pylint.

Instance of 'ScriptMaker' has no 'get_command_name' member
Error

Line: 327 Column: 32

                          first_line = f.readline()
            if not first_line:  # pragma: no cover
                logger.warning('%s: %s is an empty file (skipping)',
                               self.get_command_name(),  script)
                return

            match = FIRST_LINE_RE.match(first_line.replace(b'\r\n', b'\n'))
            if match:
                adjust = True

            

Reported by Pylint.

Module 'os' has no '_name' member; maybe '_names'?
Error

Line: 366 Column: 50

                  def dry_run(self, value):
        self._fileop.dry_run = value

    if os.name == 'nt' or (os.name == 'java' and os._name == 'nt'):  # pragma: no cover
        # Executable launcher support.
        # Launchers are from https://bitbucket.org/vinay.sajip/simple_launcher/

        def _get_launcher(self, kind):
            if struct.calcsize('P') == 8:   # 64-bit

            

Reported by Pylint.

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

Line: 205 Column: 13

                      try:
            shebang.decode('utf-8')
        except UnicodeDecodeError:  # pragma: no cover
            raise ValueError(
                'The shebang (%r) is not decodable from utf-8' % shebang)
        # If the script is encoded to a custom encoding (use a
        # #coding:xxx cookie), the shebang has to be decodable from
        # the script encoding too.
        if encoding != 'utf-8':

            

Reported by Pylint.

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

Line: 214 Column: 17

                          try:
                shebang.decode(encoding)
            except UnicodeDecodeError:  # pragma: no cover
                raise ValueError(
                    'The shebang (%r) is not decodable '
                    'from the script encoding (%r)' % (shebang, encoding))
        return shebang

    def _get_script_text(self, entry):

            

Reported by Pylint.

tasks/release.py
39 issues
Unable to import 'invoke'
Error

Line: 7 Column: 1

              import re
import sys

import invoke

from parver import Version
from towncrier._builder import find_fragments, render_fragments, split_fragments
from towncrier._settings import load_config


            

Reported by Pylint.

Unable to import 'parver'
Error

Line: 9 Column: 1

              
import invoke

from parver import Version
from towncrier._builder import find_fragments, render_fragments, split_fragments
from towncrier._settings import load_config

from pipenv.__version__ import __version__
from pipenv.vendor.vistir.contextmanagers import temp_environ

            

Reported by Pylint.

Unable to import 'towncrier._builder'
Error

Line: 10 Column: 1

              import invoke

from parver import Version
from towncrier._builder import find_fragments, render_fragments, split_fragments
from towncrier._settings import load_config

from pipenv.__version__ import __version__
from pipenv.vendor.vistir.contextmanagers import temp_environ


            

Reported by Pylint.

Unable to import 'towncrier._settings'
Error

Line: 11 Column: 1

              
from parver import Version
from towncrier._builder import find_fragments, render_fragments, split_fragments
from towncrier._settings import load_config

from pipenv.__version__ import __version__
from pipenv.vendor.vistir.contextmanagers import temp_environ

from .vendoring import _get_git_root, drop_dir

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              from pipenv.__version__ import __version__
from pipenv.vendor.vistir.contextmanagers import temp_environ

from .vendoring import _get_git_root, drop_dir


VERSION_FILE = "pipenv/__version__.py"
ROOT = pathlib.Path(".").parent.parent.absolute()
PACKAGE_NAME = "pipenv"

            

Reported by Pylint.

Unused variable 'fragment_filenames'
Error

Line: 57 Column: 16

                  """
    config = load_config(ROOT)
    definitions = config["types"]
    fragments, fragment_filenames = find_fragments(
        pathlib.Path(config["directory"]).absolute(),
        config["sections"],
        None,
        definitions,
    )

            

Reported by Pylint.

Unused argument 'manual'
Error

Line: 85 Column: 18

              

@invoke.task(help=release_help)
def release(ctx, manual=False, local=False, dry_run=False, pre=False, tag=None, month_offset="0"):
    trunc_month = False
    if pre:
        trunc_month = True
    drop_dist_dirs(ctx)
    version = bump_version(

            

Reported by Pylint.

Using an f-string that does not have any interpolated variables
Error

Line: 173 Column: 17

                          "pipenv run pip install -e . --upgrade --upgrade-strategy=eager", env=env
        )
        log("Building wheel using python %s ...." % py_version)
        ctx.run(f"pipenv run python setup.py sdist bdist_wheel", env=env)


@invoke.task(build_dists)
def upload_dists(ctx, repo="pypi"):
    dist_pattern = f'{PACKAGE_NAME.replace("-", "[-_]")}-*'

            

Reported by Pylint.

Redefining name 'tag_version' from outer scope (line 263)
Error

Line: 330 Column: 9

                      if not tag:
            print('Using "pre" requires a corresponding tag.')
            return
        tag_version = re.match(
            r"(?P<tag>alpha|a|beta|b|c|preview|pre|rc)(?P<version>[0-9]+)?", tag
        )
        tag_dict = tag_version.groupdict()
        tag = tag_dict.get("tag", tag)
        tag_version = int(tag_dict["version"]) if tag_dict["version"] is not None else 0

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import datetime
import os
import pathlib
import re
import sys

import invoke

from parver import Version

            

Reported by Pylint.

pipenv/vendor/vistir/contextmanagers.py
39 issues
Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              
import six

from .compat import IS_TYPE_CHECKING, NamedTemporaryFile, Path
from .path import is_file_url, is_valid_url, path_to_url, url_to_path

if IS_TYPE_CHECKING:
    from typing import (
        Any,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              import six

from .compat import IS_TYPE_CHECKING, NamedTemporaryFile, Path
from .path import is_file_url, is_valid_url, path_to_url, url_to_path

if IS_TYPE_CHECKING:
    from typing import (
        Any,
        Bytes,

            

Reported by Pylint.

No name 'Bytes' in module 'typing'
Error

Line: 16 Column: 5

              from .path import is_file_url, is_valid_url, path_to_url, url_to_path

if IS_TYPE_CHECKING:
    from typing import (
        Any,
        Bytes,
        Callable,
        ContextManager,
        Dict,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 5

                  from requests import Session
    from six.moves.http_client import HTTPResponse as Urllib_HTTPResponse
    from urllib3.response import HTTPResponse as Urllib3_HTTPResponse
    from .spin import VistirSpinner, DummySpinner

    TSpinner = Union[VistirSpinner, DummySpinner]
    _T = TypeVar("_T")



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 175 Column: 5

                      RuntimeError -- Raised if the spinner extra is not installed
    """

    from .spin import create_spinner

    has_yaspin = None
    try:
        import yaspin
    except ImportError:

            

Reported by Pylint.

Unused Any imported from typing
Error

Line: 16 Column: 5

              from .path import is_file_url, is_valid_url, path_to_url, url_to_path

if IS_TYPE_CHECKING:
    from typing import (
        Any,
        Bytes,
        Callable,
        ContextManager,
        Dict,

            

Reported by Pylint.

Unused Bytes imported from typing
Error

Line: 16 Column: 5

              from .path import is_file_url, is_valid_url, path_to_url, url_to_path

if IS_TYPE_CHECKING:
    from typing import (
        Any,
        Bytes,
        Callable,
        ContextManager,
        Dict,

            

Reported by Pylint.

Unused ModuleType imported from types
Error

Line: 30 Column: 5

                      Tuple,
        TypeVar,
    )
    from types import ModuleType
    from requests import Session
    from six.moves.http_client import HTTPResponse as Urllib_HTTPResponse
    from urllib3.response import HTTPResponse as Urllib3_HTTPResponse
    from .spin import VistirSpinner, DummySpinner


            

Reported by Pylint.

Unused argument 'kwargs'
Error

Line: 130 Column: 1

              

@contextmanager
def dummy_spinner(spin_type, text, **kwargs):
    # type: (str, str, Any)
    class FakeClass(object):
        def __init__(self, text=""):
            self.text = text


            

Reported by Pylint.

Unused argument 'spin_type'
Error

Line: 130 Column: 19

              

@contextmanager
def dummy_spinner(spin_type, text, **kwargs):
    # type: (str, str, Any)
    class FakeClass(object):
        def __init__(self, text=""):
            self.text = text


            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/filters/sanitizer.py
39 issues
Unable to import 'pipenv.patched.notpip._vendor.six.moves'
Error

Line: 6 Column: 1

              import re
from xml.sax.saxutils import escape, unescape

from pipenv.patched.notpip._vendor.six.moves import urllib_parse as urlparse

from . import base
from ..constants import namespaces, prefixes

__all__ = ["Filter"]

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
from pipenv.patched.notpip._vendor.six.moves import urllib_parse as urlparse

from . import base
from ..constants import namespaces, prefixes

__all__ = ["Filter"]



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              from pipenv.patched.notpip._vendor.six.moves import urllib_parse as urlparse

from . import base
from ..constants import namespaces, prefixes

__all__ = ["Filter"]


allowed_elements = frozenset((

            

Reported by Pylint.

Redefining name 'allowed_elements' from outer scope (line 14)
Error

Line: 711 Column: 18

                  """Sanitizes token stream of XHTML+MathML+SVG and of inline style attributes"""
    def __init__(self,
                 source,
                 allowed_elements=allowed_elements,
                 allowed_attributes=allowed_attributes,
                 allowed_css_properties=allowed_css_properties,
                 allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,

            

Reported by Pylint.

Redefining name 'allowed_attributes' from outer scope (line 178)
Error

Line: 712 Column: 18

                  def __init__(self,
                 source,
                 allowed_elements=allowed_elements,
                 allowed_attributes=allowed_attributes,
                 allowed_css_properties=allowed_css_properties,
                 allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,
                 allowed_content_types=allowed_content_types,

            

Reported by Pylint.

Redefining name 'allowed_css_properties' from outer scope (line 555)
Error

Line: 713 Column: 18

                               source,
                 allowed_elements=allowed_elements,
                 allowed_attributes=allowed_attributes,
                 allowed_css_properties=allowed_css_properties,
                 allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,
                 allowed_content_types=allowed_content_types,
                 attr_val_is_uri=attr_val_is_uri,

            

Reported by Pylint.

Redefining name 'allowed_css_keywords' from outer scope (line 604)
Error

Line: 714 Column: 18

                               allowed_elements=allowed_elements,
                 allowed_attributes=allowed_attributes,
                 allowed_css_properties=allowed_css_properties,
                 allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,
                 allowed_content_types=allowed_content_types,
                 attr_val_is_uri=attr_val_is_uri,
                 svg_attr_val_allows_ref=svg_attr_val_allows_ref,

            

Reported by Pylint.

Redefining name 'allowed_svg_properties' from outer scope (line 646)
Error

Line: 715 Column: 18

                               allowed_attributes=allowed_attributes,
                 allowed_css_properties=allowed_css_properties,
                 allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,
                 allowed_content_types=allowed_content_types,
                 attr_val_is_uri=attr_val_is_uri,
                 svg_attr_val_allows_ref=svg_attr_val_allows_ref,
                 svg_allow_local_href=svg_allow_local_href):

            

Reported by Pylint.

Redefining name 'allowed_protocols' from outer scope (line 657)
Error

Line: 716 Column: 18

                               allowed_css_properties=allowed_css_properties,
                 allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,
                 allowed_content_types=allowed_content_types,
                 attr_val_is_uri=attr_val_is_uri,
                 svg_attr_val_allows_ref=svg_attr_val_allows_ref,
                 svg_allow_local_href=svg_allow_local_href):
        """Creates a Filter

            

Reported by Pylint.

Redefining name 'allowed_content_types' from outer scope (line 683)
Error

Line: 717 Column: 18

                               allowed_css_keywords=allowed_css_keywords,
                 allowed_svg_properties=allowed_svg_properties,
                 allowed_protocols=allowed_protocols,
                 allowed_content_types=allowed_content_types,
                 attr_val_is_uri=attr_val_is_uri,
                 svg_attr_val_allows_ref=svg_attr_val_allows_ref,
                 svg_allow_local_href=svg_allow_local_href):
        """Creates a Filter


            

Reported by Pylint.

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

Line: 12 Column: 1

              
from markupsafe import Markup

from .utils import _PassArg

if t.TYPE_CHECKING:
    import typing_extensions as te
    from .environment import Environment


            

Reported by Pylint.

Unable to import 'typing_extensions'
Error

Line: 15 Column: 5

              from .utils import _PassArg

if t.TYPE_CHECKING:
    import typing_extensions as te
    from .environment import Environment

_NodeBound = t.TypeVar("_NodeBound", bound="Node")

_binop_to_func: t.Dict[str, t.Callable[[t.Any, t.Any], t.Any]] = {

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 5

              
if t.TYPE_CHECKING:
    import typing_extensions as te
    from .environment import Environment

_NodeBound = t.TypeVar("_NodeBound", bound="Node")

_binop_to_func: t.Dict[str, t.Callable[[t.Any, t.Any], t.Any]] = {
    "*": operator.mul,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 600 Column: 9

                      constant value in the generated code, otherwise it will raise
        an `Impossible` exception.
        """
        from .compiler import has_safe_repr

        if not has_safe_repr(value):
            raise Impossible()
        return cls(value, lineno=lineno, environment=environment)


            

Reported by Pylint.

Instance of 'And' has no 'right' member
Error

Line: 997 Column: 49

              
    def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
        eval_ctx = get_eval_context(self, eval_ctx)
        return self.left.as_const(eval_ctx) and self.right.as_const(eval_ctx)


class Or(BinExpr):
    """Short circuited OR."""


            

Reported by Pylint.

Instance of 'And' has no 'left' member
Error

Line: 997 Column: 16

              
    def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
        eval_ctx = get_eval_context(self, eval_ctx)
        return self.left.as_const(eval_ctx) and self.right.as_const(eval_ctx)


class Or(BinExpr):
    """Short circuited OR."""


            

Reported by Pylint.

Instance of 'Or' has no 'left' member
Error

Line: 1007 Column: 16

              
    def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
        eval_ctx = get_eval_context(self, eval_ctx)
        return self.left.as_const(eval_ctx) or self.right.as_const(eval_ctx)


class Not(UnaryExpr):
    """Negate the expression."""


            

Reported by Pylint.

Instance of 'Or' has no 'right' member
Error

Line: 1007 Column: 48

              
    def as_const(self, eval_ctx: t.Optional[EvalContext] = None) -> t.Any:
        eval_ctx = get_eval_context(self, eval_ctx)
        return self.left.as_const(eval_ctx) or self.right.as_const(eval_ctx)


class Not(UnaryExpr):
    """Negate the expression."""


            

Reported by Pylint.

Unused typing_extensions imported as te
Error

Line: 15 Column: 5

              from .utils import _PassArg

if t.TYPE_CHECKING:
    import typing_extensions as te
    from .environment import Environment

_NodeBound = t.TypeVar("_NodeBound", bound="Node")

_binop_to_func: t.Dict[str, t.Callable[[t.Any, t.Any], t.Any]] = {

            

Reported by Pylint.

Unused Environment imported from environment
Error

Line: 16 Column: 5

              
if t.TYPE_CHECKING:
    import typing_extensions as te
    from .environment import Environment

_NodeBound = t.TypeVar("_NodeBound", bound="Node")

_binop_to_func: t.Dict[str, t.Callable[[t.Any, t.Any], t.Any]] = {
    "*": operator.mul,

            

Reported by Pylint.

pipenv/patched/notpip/_internal/operations/install/wheel.py
38 issues
Redefining built-in 'bin'
Error

Line: 70 Column: 9

                  # type: (str, Text) -> IO[Any]
    if sys.version_info[0] < 3:
        nl = {}  # type: Dict[str, Any]
        bin = 'b'
    else:
        nl = {'newline': ''}  # type: Dict[str, Any]
        bin = ''
    return open(name, mode + bin, **nl)


            

Reported by Pylint.

XXX RECORD hashes will need to be updated
Error

Line: 82 Column: 3

                  """Replace #!python with #!/path/to/python
    Return True if file was changed.
    """
    # XXX RECORD hashes will need to be updated
    if os.path.isfile(path):
        with open(path, 'rb') as script:
            firstline = script.readline()
            if not firstline.startswith(b'#!python'):
                return False

            

Reported by Pylint.

Use lazy % formatting in logging functions
Error

Line: 245 Column: 17

                  for row in old_csv_rows:
        if len(row) > 3:
            logger.warning(
                'RECORD line has more than three elements: {}'.format(row)
            )
        # Make a copy because we are mutating the row.
        row = list(row)
        old_path = row[0]
        new_path = installed.pop(old_path, old_path)

            

Reported by Pylint.

TODO: Investigate and break this up.
Error

Line: 309 Column: 3

                        Wheel-Version
        * when the .dist-info dir does not match the wheel
    """
    # TODO: Investigate and break this up.
    # TODO: Look into moving this into a dedicated class for representing an
    #       installation.

    source = wheeldir.rstrip(os.path.sep) + os.path.sep


            

Reported by Pylint.

TODO: Look into moving this into a dedicated class for representing an
Error

Line: 310 Column: 3

                      * when the .dist-info dir does not match the wheel
    """
    # TODO: Investigate and break this up.
    # TODO: Look into moving this into a dedicated class for representing an
    #       installation.

    source = wheeldir.rstrip(os.path.sep) + os.path.sep

    info_dir, metadata = parse_wheel(wheel_zip, name)

            

Reported by Pylint.

Redefining built-in 'filter'
Error

Line: 355 Column: 13

                          dest,  # type: str
            is_base,  # type: bool
            fixer=None,  # type: Optional[Callable[[str], Any]]
            filter=None  # type: Optional[Callable[[str], bool]]
    ):
        # type: (...) -> None
        ensure_dir(dest)  # common for the 'include' path

        for dir, subdirs, files in os.walk(source):

            

Reported by Pylint.

Redefining built-in 'dir'
Error

Line: 360 Column: 13

                      # type: (...) -> None
        ensure_dir(dest)  # common for the 'include' path

        for dir, subdirs, files in os.walk(source):
            basedir = dir[len(source):].lstrip(os.path.sep)
            destdir = os.path.join(dest, basedir)
            if is_base and basedir == '':
                subdirs[:] = [s for s in subdirs if not s.endswith('.data')]
            for f in files:

            

Reported by Pylint.

Redefining built-in 'filter'
Error

Line: 439 Column: 9

              
    for datadir in data_dirs:
        fixer = None
        filter = None
        for subdir in os.listdir(os.path.join(wheeldir, datadir)):
            fixer = None
            if subdir == 'scripts':
                fixer = fix_script
                filter = is_entrypoint_wrapper

            

Reported by Pylint.

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

Line: 556 Column: 9

                      )
    except MissingCallableSuffix as e:
        entry = e.args[0]
        raise InstallationError(
            "Invalid script entry point: {} for req: {} - A callable "
            "suffix is required. Cf https://packaging.python.org/"
            "specifications/entry-points/#use-for-scripts for more "
            "information.".format(entry, req_description)
        )

            

Reported by Pylint.

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

Line: 50 Column: 1

              logger = logging.getLogger(__name__)


def normpath(src, p):
    # type: (str, str) -> str
    return os.path.relpath(src, p).replace(os.path.sep, '/')


def rehash(path, blocksize=1 << 20):

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/filters/lint.py
38 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              
from pipenv.patched.notpip._vendor.six import text_type

from . import base
from ..constants import namespaces, voidElements

from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              from pipenv.patched.notpip._vendor.six import text_type

from . import base
from ..constants import namespaces, voidElements

from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              from . import base
from ..constants import namespaces, voidElements

from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)


class Filter(base.Filter):
    """Lints the token stream for errors

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 32 Column: 13

                  def __iter__(self):
        open_elements = []
        for token in base.Filter.__iter__(self):
            type = token["type"]
            if type in ("StartTag", "EmptyTag"):
                namespace = token["namespace"]
                name = token["name"]
                assert namespace is None or isinstance(namespace, text_type)
                assert namespace != ""

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

from pipenv.patched.notpip._vendor.six import text_type

from . import base
from ..constants import namespaces, voidElements

from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)

            

Reported by Pylint.

Constant name "spaceCharacters" doesn't conform to UPPER_CASE naming style
Error

Line: 9 Column: 1

              from ..constants import namespaces, voidElements

from ..constants import spaceCharacters
spaceCharacters = "".join(spaceCharacters)


class Filter(base.Filter):
    """Lints the token stream for errors


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 12 Column: 1

              spaceCharacters = "".join(spaceCharacters)


class Filter(base.Filter):
    """Lints the token stream for errors

    If it finds any errors, it'll raise an ``AssertionError``.

    """

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 26 Column: 9

                      :arg require_matching_tags: whether or not to require matching tags

        """
        super(Filter, self).__init__(source)
        self.require_matching_tags = require_matching_tags

    def __iter__(self):
        open_elements = []
        for token in base.Filter.__iter__(self):

            

Reported by Pylint.

Too many branches (16/12)
Error

Line: 29 Column: 5

                      super(Filter, self).__init__(source)
        self.require_matching_tags = require_matching_tags

    def __iter__(self):
        open_elements = []
        for token in base.Filter.__iter__(self):
            type = token["type"]
            if type in ("StartTag", "EmptyTag"):
                namespace = token["namespace"]

            

Reported by Pylint.

Too many statements (55/50)
Error

Line: 29 Column: 5

                      super(Filter, self).__init__(source)
        self.require_matching_tags = require_matching_tags

    def __iter__(self):
        open_elements = []
        for token in base.Filter.__iter__(self):
            type = token["type"]
            if type in ("StartTag", "EmptyTag"):
                namespace = token["namespace"]

            

Reported by Pylint.