The following issues were found

pipenv/patched/notpip/_vendor/html5lib/treebuilders/base.py
91 issues
Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from __future__ import absolute_import, division, unicode_literals
from pipenv.patched.notpip._vendor.six import text_type

from ..constants import scopingElements, tableInsertModeElements, namespaces

# The scope markers are inserted when entering object elements,
# marquees, table cells, and table captions, and are used to prevent formatting
# from "leaking" into tables, object elements, and marquees.
Marker = None

            

Reported by Pylint.

XXX - should this method be made more general?
Error

Line: 105 Column: 3

                      :arg newParent: the node to move all this node's children to

        """
        # XXX - should this method be made more general?
        for child in self.childNodes:
            newParent.appendChild(child)
        self.childNodes = []

    def cloneNode(self):

            

Reported by Pylint.

XXX - rename these to headElement, formElement
Error

Line: 188 Column: 3

                      self.openElements = []
        self.activeFormattingElements = ActiveFormattingElements()

        # XXX - rename these to headElement, formElement
        self.headPointer = None
        self.formPointer = None

        self.insertFromTable = False


            

Reported by Pylint.

Attribute '_insertFromTable' defined outside __init__
Error

Line: 315 Column: 9

                  def _setInsertFromTable(self, value):
        """Switch the function used to insert an element from the
        normal one to the misnested table one and back again"""
        self._insertFromTable = value
        if value:
            self.insertElement = self.insertElementTable
        else:
            self.insertElement = self.insertElementNormal


            

Reported by Pylint.

Attribute 'insertElement' defined outside __init__
Error

Line: 317 Column: 13

                      normal one to the misnested table one and back again"""
        self._insertFromTable = value
        if value:
            self.insertElement = self.insertElementTable
        else:
            self.insertElement = self.insertElementNormal

    insertFromTable = property(_getInsertFromTable, _setInsertFromTable)


            

Reported by Pylint.

Attribute 'insertElement' defined outside __init__
Error

Line: 319 Column: 13

                      if value:
            self.insertElement = self.insertElementTable
        else:
            self.insertElement = self.insertElementNormal

    insertFromTable = property(_getInsertFromTable, _setInsertFromTable)

    def insertElementNormal(self, token):
        name = token["name"]

            

Reported by Pylint.

XXX - this is really inelegant
Error

Line: 369 Column: 3

                      (or None) when inserting a misnested table node"""
        # The foster parent element is the one which comes before the most
        # recently opened table element
        # XXX - this is really inelegant
        lastTable = None
        fosterParent = None
        insertBefore = None
        for elm in self.openElements[::-1]:
            if elm.name == "table":

            

Reported by Pylint.

XXX - we should really check that this parent is actually a
Error

Line: 378 Column: 3

                              lastTable = elm
                break
        if lastTable:
            # XXX - we should really check that this parent is actually a
            # node here
            if lastTable.parent:
                fosterParent = lastTable.parent
                insertBefore = lastTable
            else:

            

Reported by Pylint.

XXX td, th and tr are not actually needed
Error

Line: 392 Column: 3

              
    def generateImpliedEndTags(self, exclude=None):
        name = self.openElements[-1].name
        # XXX td, th and tr are not actually needed
        if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt")) and
                name != exclude):
            self.openElements.pop()
            # XXX This is not entirely what the specification says. We should
            # investigate it more closely.

            

Reported by Pylint.

XXX This is not entirely what the specification says. We should
Error

Line: 396 Column: 3

                      if (name in frozenset(("dd", "dt", "li", "option", "optgroup", "p", "rp", "rt")) and
                name != exclude):
            self.openElements.pop()
            # XXX This is not entirely what the specification says. We should
            # investigate it more closely.
            self.generateImpliedEndTags(exclude)

    def getDocument(self):
        """Return the final tree"""

            

Reported by Pylint.

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

Line: 25 Column: 1

                  DecodeError, ReadTimeoutError, ProtocolError, LocationParseError)

from io import UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict

from .auth import HTTPBasicAuth
from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
from .exceptions import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 26 Column: 1

              
from io import UnsupportedOperation
from .hooks import default_hooks
from .structures import CaseInsensitiveDict

from .auth import HTTPBasicAuth
from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
from .exceptions import (
    HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

              from .hooks import default_hooks
from .structures import CaseInsensitiveDict

from .auth import HTTPBasicAuth
from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
from .exceptions import (
    HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
    ContentDecodingError, ConnectionError, StreamConsumedError, InvalidJSONError)
from ._internal_utils import to_native_string, unicode_is_ascii

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              from .structures import CaseInsensitiveDict

from .auth import HTTPBasicAuth
from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
from .exceptions import (
    HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
    ContentDecodingError, ConnectionError, StreamConsumedError, InvalidJSONError)
from ._internal_utils import to_native_string, unicode_is_ascii
from .utils import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              
from .auth import HTTPBasicAuth
from .cookies import cookiejar_from_dict, get_cookie_header, _copy_cookie_jar
from .exceptions import (
    HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
    ContentDecodingError, ConnectionError, StreamConsumedError, InvalidJSONError)
from ._internal_utils import to_native_string, unicode_is_ascii
from .utils import (
    guess_filename, get_auth_from_url, requote_uri,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 33 Column: 1

              from .exceptions import (
    HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
    ContentDecodingError, ConnectionError, StreamConsumedError, InvalidJSONError)
from ._internal_utils import to_native_string, unicode_is_ascii
from .utils import (
    guess_filename, get_auth_from_url, requote_uri,
    stream_decode_response_unicode, to_key_val_list, parse_header_links,
    iter_slices, guess_json_utf, super_len, check_header_validity)
from .compat import (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 1

                  HTTPError, MissingSchema, InvalidURL, ChunkedEncodingError,
    ContentDecodingError, ConnectionError, StreamConsumedError, InvalidJSONError)
from ._internal_utils import to_native_string, unicode_is_ascii
from .utils import (
    guess_filename, get_auth_from_url, requote_uri,
    stream_decode_response_unicode, to_key_val_list, parse_header_links,
    iter_slices, guess_json_utf, super_len, check_header_validity)
from .compat import (
    Callable, Mapping,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 38 Column: 1

                  guess_filename, get_auth_from_url, requote_uri,
    stream_decode_response_unicode, to_key_val_list, parse_header_links,
    iter_slices, guess_json_utf, super_len, check_header_validity)
from .compat import (
    Callable, Mapping,
    cookielib, urlunparse, urlsplit, urlencode, str, bytes,
    is_py2, chardet, builtin_str, basestring)
from .compat import json as complexjson
from .status_codes import codes

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 42 Column: 1

                  Callable, Mapping,
    cookielib, urlunparse, urlsplit, urlencode, str, bytes,
    is_py2, chardet, builtin_str, basestring)
from .compat import json as complexjson
from .status_codes import codes

#: The set of HTTP status codes that indicate an automatically
#: processable redirect.
REDIRECT_STATI = (

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 43 Column: 1

                  cookielib, urlunparse, urlsplit, urlencode, str, bytes,
    is_py2, chardet, builtin_str, basestring)
from .compat import json as complexjson
from .status_codes import codes

#: The set of HTTP status codes that indicate an automatically
#: processable redirect.
REDIRECT_STATI = (
    codes.moved,               # 301

            

Reported by Pylint.

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

Line: 16 Column: 1

              from markupsafe import Markup
from markupsafe import soft_str

from .async_utils import async_variant
from .async_utils import auto_aiter
from .async_utils import auto_await
from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              from markupsafe import soft_str

from .async_utils import async_variant
from .async_utils import auto_aiter
from .async_utils import auto_await
from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 18 Column: 1

              
from .async_utils import async_variant
from .async_utils import auto_aiter
from .async_utils import auto_await
from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 19 Column: 1

              from .async_utils import async_variant
from .async_utils import auto_aiter
from .async_utils import auto_await
from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 20 Column: 1

              from .async_utils import auto_aiter
from .async_utils import auto_await
from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment
from .utils import pass_eval_context

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 21 Column: 1

              from .async_utils import auto_await
from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment
from .utils import pass_eval_context
from .utils import pformat

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 22 Column: 1

              from .async_utils import auto_to_list
from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment
from .utils import pass_eval_context
from .utils import pformat
from .utils import url_quote

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

              from .exceptions import FilterArgumentError
from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment
from .utils import pass_eval_context
from .utils import pformat
from .utils import url_quote
from .utils import urlize

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 24 Column: 1

              from .runtime import Undefined
from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment
from .utils import pass_eval_context
from .utils import pformat
from .utils import url_quote
from .utils import urlize


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 25 Column: 1

              from .utils import htmlsafe_json_dumps
from .utils import pass_context
from .utils import pass_environment
from .utils import pass_eval_context
from .utils import pformat
from .utils import url_quote
from .utils import urlize

if t.TYPE_CHECKING:

            

Reported by Pylint.

pipenv/vendor/distlib/metadata.py
89 issues
Attempted relative import beyond top-level package
Error

Line: 19 Column: 1

              import re


from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 20 Column: 1

              

from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 21 Column: 1

              
from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 22 Column: 1

              from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

              from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)


class MetadataMissingError(DistlibException):

            

Reported by Pylint.

TODO document the mapping API and UNKNOWN default key
Error

Line: 248 Column: 3

                  - *mapping* is a dict-like object
    - *scheme* is a version scheme name
    """
    # TODO document the mapping API and UNKNOWN default key

    def __init__(self, path=None, fileobj=None, mapping=None,
                 scheme='default'):
        if [path, fileobj, mapping].count(None) < 2:
            raise TypeError('path, fileobj and mapping are exclusive')

            

Reported by Pylint.

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

Line: 283 Column: 13

                      try:
            del self._fields[field_name]
        except KeyError:
            raise KeyError(name)

    def __contains__(self, name):
        return (name in self._fields or
                self._convert_name(name) in self._fields)


            

Reported by Pylint.

FIXME this rejects UNKNOWN, is that right?
Error

Line: 457 Column: 3

                                      logger.warning(
                            "'%s': '%s' is not valid (field '%s')",
                            project_name, v, name)
            # FIXME this rejects UNKNOWN, is that right?
            elif name in _VERSIONS_FIELDS and value is not None:
                if not scheme.is_valid_constraint_list(value):
                    logger.warning("'%s': '%s' is not a valid version (field '%s')",
                                   project_name, value, name)
            elif name in _VERSION_FIELDS and value is not None:

            

Reported by Pylint.

XXX should check the versions (if the file was loaded)
Error

Line: 507 Column: 3

                      no Name or Version are provided"""
        self.set_metadata_version()

        # XXX should check the versions (if the file was loaded)
        missing, warnings = [], []

        for attr in ('Name', 'Version'):  # required by PEP 345
            if attr not in self:
                missing.append(attr)

            

Reported by Pylint.

TODO could add iter* variants
Error

Line: 578 Column: 3

                      self['Requires-Dist'] += requirements

    # Mapping API
    # TODO could add iter* variants

    def keys(self):
        return list(_version2fieldlist(self['Metadata-Version']))

    def __iter__(self):

            

Reported by Pylint.

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

Line: 13 Column: 1

              
import six

from .backports.tempfile import NamedTemporaryFile as _NamedTemporaryFile

__all__ = [
    "Path",
    "get_terminal_size",
    "finalize",

            

Reported by Pylint.

Unable to import 'pathlib2'
Error

Line: 58 Column: 5

              if sys.version_info >= (3, 5):  # pragma: no cover
    from pathlib import Path
else:  # pragma: no cover
    from pathlib2 import Path

if sys.version_info >= (3, 4):  # pragma: no cover
    # Only Python 3.4+ is supported
    from functools import lru_cache, partialmethod
    from tempfile import NamedTemporaryFile

            

Reported by Pylint.

Unable to import 'backports.functools_lru_cache'
Error

Line: 88 Column: 5

              
else:  # pragma: no cover
    # Only Python 2.7 is supported
    from backports.functools_lru_cache import lru_cache
    from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,

            

Reported by Pylint.

Unable to import 'backports.shutil_get_terminal_size'
Error

Line: 89 Column: 5

              else:  # pragma: no cover
    # Only Python 2.7 is supported
    from backports.functools_lru_cache import lru_cache
    from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 90 Column: 5

                  # Only Python 2.7 is supported
    from backports.functools_lru_cache import lru_cache
    from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,
        MutableMapping,

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 91 Column: 5

                  from backports.functools_lru_cache import lru_cache
    from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,
        MutableMapping,
        Container,

            

Reported by Pylint.

No name 'Iterator' in module 'collections'
Error

Line: 92 Column: 5

                  from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,
        MutableMapping,
        Container,
        Iterator,

            

Reported by Pylint.

No name 'Hashable' in module 'collections'
Error

Line: 92 Column: 5

                  from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,
        MutableMapping,
        Container,
        Iterator,

            

Reported by Pylint.

No name 'Sequence' in module 'collections'
Error

Line: 92 Column: 5

                  from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,
        MutableMapping,
        Container,
        Iterator,

            

Reported by Pylint.

No name 'ValuesView' in module 'collections'
Error

Line: 92 Column: 5

                  from backports.shutil_get_terminal_size import get_terminal_size
    from .backports.functools import partialmethod  # type: ignore
    from .backports.surrogateescape import register_surrogateescape
    from collections import (
        Mapping,
        Hashable,
        MutableMapping,
        Container,
        Iterator,

            

Reported by Pylint.

tests/integration/test_project.py
88 issues
Unable to import 'pytest'
Error

Line: 6 Column: 1

              
from pathlib import Path

import pytest

from pipenv.patched import pipfile
from pipenv.project import Project
from pipenv.utils import temp_environ
from pipenv.vendor.vistir.path import is_in_path, normalize_path

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import os
import tarfile

from pathlib import Path

import pytest

from pipenv.patched import pipfile
from pipenv.project import Project

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 1

              @pytest.mark.project
@pytest.mark.sources
@pytest.mark.environ
def test_pipfile_envvar_expansion(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with temp_environ():
            with open(p.pipfile_path, 'w') as f:
                f.write("""
[[source]]

            

Reported by Pylint.

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

Line: 17 Column: 1

              @pytest.mark.project
@pytest.mark.sources
@pytest.mark.environ
def test_pipfile_envvar_expansion(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with temp_environ():
            with open(p.pipfile_path, 'w') as f:
                f.write("""
[[source]]

            

Reported by Pylint.

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

Line: 18 Column: 40

              @pytest.mark.sources
@pytest.mark.environ
def test_pipfile_envvar_expansion(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with temp_environ():
            with open(p.pipfile_path, 'w') as f:
                f.write("""
[[source]]
url = 'https://${TEST_HOST}/simple'

            

Reported by Pylint.

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

Line: 20 Column: 47

              def test_pipfile_envvar_expansion(PipenvInstance):
    with PipenvInstance(chdir=True) as p:
        with temp_environ():
            with open(p.pipfile_path, 'w') as f:
                f.write("""
[[source]]
url = 'https://${TEST_HOST}/simple'
verify_ssl = false
name = "pypi"

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 32
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                              """.strip())
            os.environ['TEST_HOST'] = 'localhost:5000'
            project = Project()
            assert project.sources[0]['url'] == 'https://localhost:5000/simple'
            assert 'localhost:5000' not in str(pipfile.load(p.pipfile_path))


@pytest.mark.project
@pytest.mark.sources

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 33
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                          os.environ['TEST_HOST'] = 'localhost:5000'
            project = Project()
            assert project.sources[0]['url'] == 'https://localhost:5000/simple'
            assert 'localhost:5000' not in str(pipfile.load(p.pipfile_path))


@pytest.mark.project
@pytest.mark.sources
@pytest.mark.parametrize('lock_first', [True, False])

            

Reported by Bandit.

Missing function or method docstring
Error

Line: 39 Column: 1

              @pytest.mark.project
@pytest.mark.sources
@pytest.mark.parametrize('lock_first', [True, False])
def test_get_source(PipenvInstance, lock_first):
    with PipenvInstance(chdir=True) as p:
        with open(p.pipfile_path, 'w') as f:
            contents = """
[[source]]
url = "{0}"

            

Reported by Pylint.

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

Line: 39 Column: 1

              @pytest.mark.project
@pytest.mark.sources
@pytest.mark.parametrize('lock_first', [True, False])
def test_get_source(PipenvInstance, lock_first):
    with PipenvInstance(chdir=True) as p:
        with open(p.pipfile_path, 'w') as f:
            contents = """
[[source]]
url = "{0}"

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/_ihatexml.py
87 issues
Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              import re
import warnings

from .constants import DataLossWarning

baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] |

            

Reported by Pylint.

Redefining name 'name' from outer scope (line 95)
Error

Line: 209 Column: 31

              
        self.replaceCache = {}

    def coerceAttribute(self, name, namespace=None):
        if self.dropXmlnsLocalName and name.startswith("xmlns:"):
            warnings.warn("Attributes cannot begin with xmlns", DataLossWarning)
            return None
        elif (self.dropXmlnsAttrNs and
              namespace == "http://www.w3.org/2000/xmlns/"):

            

Reported by Pylint.

Redefining name 'name' from outer scope (line 95)
Error

Line: 220 Column: 29

                      else:
            return self.toXmlName(name)

    def coerceElement(self, name):
        return self.toXmlName(name)

    def coerceComment(self, data):
        if self.preventDoubleDashComments:
            while "--" in data:

            

Reported by Pylint.

Redefining name 'name' from outer scope (line 95)
Error

Line: 252 Column: 25

                          dataOutput = dataOutput.replace("'", self.getReplacementCharacter("'"))
        return dataOutput

    def toXmlName(self, name):
        nameFirst = name[0]
        nameRest = name[1:]
        m = nonXmlNameFirstBMPRegexp.match(nameFirst)
        if m:
            warnings.warn("Coercing non-XML name", DataLossWarning)

            

Reported by Pylint.

Redefining name 'nameFirst' from outer scope (line 97)
Error

Line: 253 Column: 9

                      return dataOutput

    def toXmlName(self, name):
        nameFirst = name[0]
        nameRest = name[1:]
        m = nonXmlNameFirstBMPRegexp.match(nameFirst)
        if m:
            warnings.warn("Coercing non-XML name", DataLossWarning)
            nameFirstOutput = self.getReplacementCharacter(nameFirst)

            

Reported by Pylint.

Redefining name 'name' from outer scope (line 95)
Error

Line: 277 Column: 27

                          replacement = self.escapeChar(char)
        return replacement

    def fromXmlName(self, name):
        for item in set(self.replacementRegexp.findall(name)):
            name = name.replace(item, self.unescapeChar(item))
        return name

    def escapeChar(self, char):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import absolute_import, division, unicode_literals

import re
import warnings

from .constants import DataLossWarning

baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |

            

Reported by Pylint.

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

Line: 8 Column: 1

              
from .constants import DataLossWarning

baseChar = """
[#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | [#x00D8-#x00F6] |
[#x00F8-#x00FF] | [#x0100-#x0131] | [#x0134-#x013E] | [#x0141-#x0148] |
[#x014A-#x017E] | [#x0180-#x01C3] | [#x01CD-#x01F0] | [#x01F4-#x01F5] |
[#x01FA-#x0217] | [#x0250-#x02A8] | [#x02BB-#x02C1] | #x0386 |
[#x0388-#x038A] | #x038C | [#x038E-#x03A1] | [#x03A3-#x03CE] |

            

Reported by Pylint.

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

Line: 56 Column: 1

              [#x212A-#x212B] | #x212E | [#x2180-#x2182] | [#x3041-#x3094] |
[#x30A1-#x30FA] | [#x3105-#x312C] | [#xAC00-#xD7A3]"""

ideographic = """[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]"""

combiningCharacter = """
[#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] |
[#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 |
[#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] |

            

Reported by Pylint.

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

Line: 58 Column: 1

              
ideographic = """[#x4E00-#x9FA5] | #x3007 | [#x3021-#x3029]"""

combiningCharacter = """
[#x0300-#x0345] | [#x0360-#x0361] | [#x0483-#x0486] | [#x0591-#x05A1] |
[#x05A3-#x05B9] | [#x05BB-#x05BD] | #x05BF | [#x05C1-#x05C2] | #x05C4 |
[#x064B-#x0652] | #x0670 | [#x06D6-#x06DC] | [#x06DD-#x06DF] |
[#x06E0-#x06E4] | [#x06E7-#x06E8] | [#x06EA-#x06ED] | [#x0901-#x0903] |
#x093C | [#x093E-#x094C] | #x094D | [#x0951-#x0954] | [#x0962-#x0963] |

            

Reported by Pylint.

pipenv/vendor/cerberus/validator.py
87 issues
Unable to import 'cerberus'
Error

Line: 19 Column: 1

              import re
from warnings import warn

from cerberus import errors
from cerberus.platform import (
    _int_types,
    _str_type,
    Container,
    Hashable,

            

Reported by Pylint.

Unable to import 'cerberus.platform'
Error

Line: 20 Column: 1

              from warnings import warn

from cerberus import errors
from cerberus.platform import (
    _int_types,
    _str_type,
    Container,
    Hashable,
    Iterable,

            

Reported by Pylint.

Unable to import 'cerberus.schema'
Error

Line: 30 Column: 1

                  Sequence,
    Sized,
)
from cerberus.schema import (
    schema_registry,
    rules_set_registry,
    DefinitionSchema,
    SchemaError,
)

            

Reported by Pylint.

Unable to import 'cerberus.utils'
Error

Line: 36 Column: 1

                  DefinitionSchema,
    SchemaError,
)
from cerberus.utils import drop_item_from_tuple, readonly_classproperty, TypeDefinition

toy_error_handler = errors.ToyErrorHandler()


def dummy_for_rule_validation(rule_constraints):

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 621 Column: 5

                  # FIXME the returned method has the correct docstring, but doesn't appear
    #       in the API docs
    @readonly_classproperty
    def types(cls):
        """
        The constraints that can be used for the 'type' rule.
        Type: A tuple of strings.
        """
        redundant_types = set(cls.types_mapping) & set(cls._types_from_methods)

            

Reported by Pylint.

Instance of 'BareValidator' has no '_types_from_methods' member
Error

Line: 626 Column: 56

                      The constraints that can be used for the 'type' rule.
        Type: A tuple of strings.
        """
        redundant_types = set(cls.types_mapping) & set(cls._types_from_methods)
        if redundant_types:
            warn(
                "These types are defined both with a method and in the"
                "'types_mapping' property of this validator: %s" % redundant_types
            )

            

Reported by Pylint.

Instance of 'BareValidator' has no '_types_from_methods' member
Error

Line: 633 Column: 43

                              "'types_mapping' property of this validator: %s" % redundant_types
            )

        return tuple(cls.types_mapping) + cls._types_from_methods

    # Document processing

    def __init_processing(self, document, schema=None):
        self._errors = errors.ErrorList()

            

Reported by Pylint.

validator is not callable
Error

Line: 1095 Column: 20

              
        def validate_rule(rule):
            validator = self.__get_rule_handler('validate', rule)
            return validator(definitions.get(rule, None), field, value)

        definitions = self._resolve_rules_set(definitions)
        value = self.document[field]

        rules_queue = [

            

Reported by Pylint.

Instance of 'BareValidator' has no 'normalization_rules' member
Error

Line: 1112 Column: 26

                          x
            for x in definitions
            if x not in rules_queue
            and x not in self.normalization_rules
            and x not in ('allow_unknown', 'require_all', 'meta', 'required')
        )
        self._remaining_rules = rules_queue

        while self._remaining_rules:

            

Reported by Pylint.

type_handler is not callable
Error

Line: 1556 Column: 27

                              ) and not isinstance(value, type_definition.excluded_types)
            else:
                type_handler = self.__get_rule_handler('validate_type', _type)
                matched = type_handler(value)
            if matched:
                return

            # TODO uncomment this block on next major release
            #      when _validate_type_* methods were deprecated:

            

Reported by Pylint.

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

Line: 19 Column: 1

              import re


from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 20 Column: 1

              

from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 21 Column: 1

              
from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 22 Column: 1

              from . import DistlibException, __version__
from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

              from .compat import StringIO, string_types, text_type
from .markers import interpret
from .util import extract_by_key, get_extras
from .version import get_scheme, PEP440_VERSION_RE

logger = logging.getLogger(__name__)


class MetadataMissingError(DistlibException):

            

Reported by Pylint.

TODO document the mapping API and UNKNOWN default key
Error

Line: 272 Column: 3

                  - *mapping* is a dict-like object
    - *scheme* is a version scheme name
    """
    # TODO document the mapping API and UNKNOWN default key

    def __init__(self, path=None, fileobj=None, mapping=None,
                 scheme='default'):
        if [path, fileobj, mapping].count(None) < 2:
            raise TypeError('path, fileobj and mapping are exclusive')

            

Reported by Pylint.

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

Line: 307 Column: 13

                      try:
            del self._fields[field_name]
        except KeyError:
            raise KeyError(name)

    def __contains__(self, name):
        return (name in self._fields or
                self._convert_name(name) in self._fields)


            

Reported by Pylint.

FIXME this rejects UNKNOWN, is that right?
Error

Line: 476 Column: 3

                                      logger.warning(
                            "'%s': '%s' is not valid (field '%s')",
                            project_name, v, name)
            # FIXME this rejects UNKNOWN, is that right?
            elif name in _VERSIONS_FIELDS and value is not None:
                if not scheme.is_valid_constraint_list(value):
                    logger.warning("'%s': '%s' is not a valid version (field '%s')",
                                   project_name, value, name)
            elif name in _VERSION_FIELDS and value is not None:

            

Reported by Pylint.

XXX should check the versions (if the file was loaded)
Error

Line: 526 Column: 3

                      no Name or Version are provided"""
        self.set_metadata_version()

        # XXX should check the versions (if the file was loaded)
        missing, warnings = [], []

        for attr in ('Name', 'Version'):  # required by PEP 345
            if attr not in self:
                missing.append(attr)

            

Reported by Pylint.

TODO could add iter* variants
Error

Line: 633 Column: 3

                      self['Requires-Dist'] += requirements

    # Mapping API
    # TODO could add iter* variants

    def keys(self):
        return list(_version2fieldlist(self['Metadata-Version']))

    def __iter__(self):

            

Reported by Pylint.

pipenv/patched/notpip/_vendor/html5lib/treebuilders/etree.py
87 issues
Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
import re

from . import base
from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import re

from . import base
from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory

tag_regexp = re.compile("{([^}]*)}(.*)")

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 10 Column: 1

              
from . import base
from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory

tag_regexp = re.compile("{([^}]*)}(.*)")


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              from . import base
from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory

tag_regexp = re.compile("{([^}]*)}(.*)")



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              from .. import _ihatexml
from .. import constants
from ..constants import namespaces
from .._utils import moduleFactoryFactory

tag_regexp = re.compile("{([^}]*)}(.*)")


def getETreeBuilder(ElementTreeImplementation, fullTree=False):

            

Reported by Pylint.

XXX - there may be a better way to do this...
Error

Line: 65 Column: 3

              
        def _setAttributes(self, attributes):
            # Delete existing attributes first
            # XXX - there may be a better way to do this...
            for key in list(self._element.attrib.keys()):
                del self._element.attrib[key]
            for key, value in attributes.items():
                if isinstance(key, tuple):
                    name = "{%s}%s" % (key[2], key[1])

            

Reported by Pylint.

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

Line: 148 Column: 9

                          base.Node.reparentChildren(self, newParent)

    class Comment(Element):
        def __init__(self, data):
            # Use the superclass constructor to set all properties on the
            # wrapper element
            self._element = ElementTree.Comment(data)
            self.parent = None
            self._childNodes = []

            

Reported by Pylint.

Possibly unused variable 'tostring'
Error

Line: 259 Column: 5

              
        return "\n".join(rv)

    def tostring(element):  # pylint:disable=unused-variable
        """Serialize an element and its child nodes to a string"""
        rv = []
        filter = _ihatexml.InfosetFilter()

        def serializeElement(element):

            

Reported by Pylint.

Redefining built-in 'filter'
Error

Line: 262 Column: 9

                  def tostring(element):  # pylint:disable=unused-variable
        """Serialize an element and its child nodes to a string"""
        rv = []
        filter = _ihatexml.InfosetFilter()

        def serializeElement(element):
            if isinstance(element, ElementTree.ElementTree):
                element = element.getroot()


            

Reported by Pylint.

Possibly unused variable 'TreeBuilder'
Error

Line: 313 Column: 5

              
        return "".join(rv)

    class TreeBuilder(base.TreeBuilder):  # pylint:disable=unused-variable
        documentClass = Document
        doctypeClass = DocumentType
        elementClass = Element
        commentClass = Comment
        fragmentClass = DocumentFragment

            

Reported by Pylint.