The following issues were found
pipenv/patched/notpip/_internal/index/collector.py
19 issues
Line: 15
Column: 1
from pipenv.patched.notpip._vendor import html5lib, requests
from pipenv.patched.notpip._vendor.distlib.compat import unescape
from pipenv.patched.notpip._vendor.requests.exceptions import HTTPError, RetryError, SSLError
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request
from pipenv.patched.notpip._internal.models.link import Link
from pipenv.patched.notpip._internal.utils.filetypes import ARCHIVE_EXTENSIONS
from pipenv.patched.notpip._internal.utils.misc import redact_auth_from_url
Reported by Pylint.
Line: 15
Column: 1
from pipenv.patched.notpip._vendor import html5lib, requests
from pipenv.patched.notpip._vendor.distlib.compat import unescape
from pipenv.patched.notpip._vendor.requests.exceptions import HTTPError, RetryError, SSLError
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request
from pipenv.patched.notpip._internal.models.link import Link
from pipenv.patched.notpip._internal.utils.filetypes import ARCHIVE_EXTENSIONS
from pipenv.patched.notpip._internal.utils.misc import redact_auth_from_url
Reported by Pylint.
Line: 16
Column: 1
from pipenv.patched.notpip._vendor.distlib.compat import unescape
from pipenv.patched.notpip._vendor.requests.exceptions import HTTPError, RetryError, SSLError
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request
from pipenv.patched.notpip._internal.models.link import Link
from pipenv.patched.notpip._internal.utils.filetypes import ARCHIVE_EXTENSIONS
from pipenv.patched.notpip._internal.utils.misc import redact_auth_from_url
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
Reported by Pylint.
Line: 16
Column: 1
from pipenv.patched.notpip._vendor.distlib.compat import unescape
from pipenv.patched.notpip._vendor.requests.exceptions import HTTPError, RetryError, SSLError
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._vendor.six.moves.urllib import request as urllib_request
from pipenv.patched.notpip._internal.models.link import Link
from pipenv.patched.notpip._internal.utils.filetypes import ARCHIVE_EXTENSIONS
from pipenv.patched.notpip._internal.utils.misc import redact_auth_from_url
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
Reported by Pylint.
Line: 97
Column: 13
Raises `_NotHTTP` if the URL is not available for a HEAD request, or
`_NotHTML` if the content type is not text/html.
"""
scheme, netloc, path, query, fragment = urllib_parse.urlsplit(url)
if scheme not in {'http', 'https'}:
raise _NotHTTP()
resp = session.head(url, allow_redirects=True)
resp.raise_for_status()
Reported by Pylint.
Line: 97
Column: 34
Raises `_NotHTTP` if the URL is not available for a HEAD request, or
`_NotHTML` if the content type is not text/html.
"""
scheme, netloc, path, query, fragment = urllib_parse.urlsplit(url)
if scheme not in {'http', 'https'}:
raise _NotHTTP()
resp = session.head(url, allow_redirects=True)
resp.raise_for_status()
Reported by Pylint.
Line: 97
Column: 21
Raises `_NotHTTP` if the URL is not available for a HEAD request, or
`_NotHTML` if the content type is not text/html.
"""
scheme, netloc, path, query, fragment = urllib_parse.urlsplit(url)
if scheme not in {'http', 'https'}:
raise _NotHTTP()
resp = session.head(url, allow_redirects=True)
resp.raise_for_status()
Reported by Pylint.
Line: 97
Column: 27
Raises `_NotHTTP` if the URL is not available for a HEAD request, or
`_NotHTML` if the content type is not text/html.
"""
scheme, netloc, path, query, fragment = urllib_parse.urlsplit(url)
if scheme not in {'http', 'https'}:
raise _NotHTTP()
resp = session.head(url, allow_redirects=True)
resp.raise_for_status()
Reported by Pylint.
Line: 163
Column: 9
"""Determine if we have any encoding information in our headers.
"""
if headers and "Content-Type" in headers:
content_type, params = cgi.parse_header(headers["Content-Type"])
if "charset" in params:
return params['charset']
return None
Reported by Pylint.
Line: 412
Column: 25
urls.append(url)
else:
logger.warning(
"Path '{0}' is ignored: "
"it is a directory.".format(path),
)
elif os.path.isfile(path):
sort_path(path)
else:
Reported by Pylint.
pipenv/patched/notpip/_vendor/chardet/utf8prober.py
19 issues
Line: 28
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
Reported by Pylint.
Line: 29
Column: 1
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
Reported by Pylint.
Line: 30
Column: 1
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
class UTF8Prober(CharSetProber):
Reported by Pylint.
Line: 31
Column: 1
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
class UTF8Prober(CharSetProber):
ONE_CHAR_PROB = 0.5
Reported by Pylint.
Line: 61
Column: 17
for c in byte_str:
coding_state = self.coding_sm.next_state(c)
if coding_state == MachineState.ERROR:
self._state = ProbingState.NOT_ME
break
elif coding_state == MachineState.ITS_ME:
self._state = ProbingState.FOUND_IT
break
elif coding_state == MachineState.START:
Reported by Pylint.
Line: 64
Column: 17
self._state = ProbingState.NOT_ME
break
elif coding_state == MachineState.ITS_ME:
self._state = ProbingState.FOUND_IT
break
elif coding_state == MachineState.START:
if self.coding_sm.get_current_charlen() >= 2:
self._num_mb_chars += 1
Reported by Pylint.
Line: 72
Column: 17
if self.state == ProbingState.DETECTING:
if self.get_confidence() > self.SHORTCUT_THRESHOLD:
self._state = ProbingState.FOUND_IT
return self.state
def get_confidence(self):
unlike = 0.99
Reported by Pylint.
Line: 1
Column: 1
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
Reported by Pylint.
Line: 35
Column: 1
class UTF8Prober(CharSetProber):
ONE_CHAR_PROB = 0.5
def __init__(self):
super(UTF8Prober, self).__init__()
self.coding_sm = CodingStateMachine(UTF8_SM_MODEL)
Reported by Pylint.
Line: 39
Column: 9
ONE_CHAR_PROB = 0.5
def __init__(self):
super(UTF8Prober, self).__init__()
self.coding_sm = CodingStateMachine(UTF8_SM_MODEL)
self._num_mb_chars = None
self.reset()
def reset(self):
Reported by Pylint.
pipenv/vendor/chardet/utf8prober.py
19 issues
Line: 28
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
Reported by Pylint.
Line: 29
Column: 1
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
Reported by Pylint.
Line: 30
Column: 1
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
class UTF8Prober(CharSetProber):
Reported by Pylint.
Line: 31
Column: 1
from .charsetprober import CharSetProber
from .enums import ProbingState, MachineState
from .codingstatemachine import CodingStateMachine
from .mbcssm import UTF8_SM_MODEL
class UTF8Prober(CharSetProber):
ONE_CHAR_PROB = 0.5
Reported by Pylint.
Line: 61
Column: 17
for c in byte_str:
coding_state = self.coding_sm.next_state(c)
if coding_state == MachineState.ERROR:
self._state = ProbingState.NOT_ME
break
elif coding_state == MachineState.ITS_ME:
self._state = ProbingState.FOUND_IT
break
elif coding_state == MachineState.START:
Reported by Pylint.
Line: 64
Column: 17
self._state = ProbingState.NOT_ME
break
elif coding_state == MachineState.ITS_ME:
self._state = ProbingState.FOUND_IT
break
elif coding_state == MachineState.START:
if self.coding_sm.get_current_charlen() >= 2:
self._num_mb_chars += 1
Reported by Pylint.
Line: 72
Column: 17
if self.state == ProbingState.DETECTING:
if self.get_confidence() > self.SHORTCUT_THRESHOLD:
self._state = ProbingState.FOUND_IT
return self.state
def get_confidence(self):
unlike = 0.99
Reported by Pylint.
Line: 1
Column: 1
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
Reported by Pylint.
Line: 35
Column: 1
class UTF8Prober(CharSetProber):
ONE_CHAR_PROB = 0.5
def __init__(self):
super(UTF8Prober, self).__init__()
self.coding_sm = CodingStateMachine(UTF8_SM_MODEL)
Reported by Pylint.
Line: 39
Column: 9
ONE_CHAR_PROB = 0.5
def __init__(self):
super(UTF8Prober, self).__init__()
self.coding_sm = CodingStateMachine(UTF8_SM_MODEL)
self._num_mb_chars = None
self.reset()
def reset(self):
Reported by Pylint.
pipenv/vendor/dateutil/parser/__init__.py
19 issues
Line: 2
Column: 1
# -*- coding: utf-8 -*-
from ._parser import parse, parser, parserinfo, ParserError
from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
from ._parser import UnknownTimezoneWarning
from ._parser import __doc__
from .isoparser import isoparser, isoparse
Reported by Pylint.
Line: 3
Column: 1
# -*- coding: utf-8 -*-
from ._parser import parse, parser, parserinfo, ParserError
from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
from ._parser import UnknownTimezoneWarning
from ._parser import __doc__
from .isoparser import isoparser, isoparse
Reported by Pylint.
Line: 4
Column: 1
# -*- coding: utf-8 -*-
from ._parser import parse, parser, parserinfo, ParserError
from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
from ._parser import UnknownTimezoneWarning
from ._parser import __doc__
from .isoparser import isoparser, isoparse
Reported by Pylint.
Line: 6
Column: 1
from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
from ._parser import UnknownTimezoneWarning
from ._parser import __doc__
from .isoparser import isoparser, isoparse
__all__ = ['parse', 'parser', 'parserinfo',
'isoparse', 'isoparser',
Reported by Pylint.
Line: 8
Column: 1
from ._parser import __doc__
from .isoparser import isoparser, isoparse
__all__ = ['parse', 'parser', 'parserinfo',
'isoparse', 'isoparser',
'ParserError',
'UnknownTimezoneWarning']
Reported by Pylint.
Line: 55
Column: 1
return private_class
from ._parser import _timelex, _resultbase
from ._parser import _tzparser, _parsetz
_timelex = __deprecate_private_class(_timelex)
_tzparser = __deprecate_private_class(_tzparser)
_resultbase = __deprecate_private_class(_resultbase)
Reported by Pylint.
Line: 56
Column: 1
from ._parser import _timelex, _resultbase
from ._parser import _tzparser, _parsetz
_timelex = __deprecate_private_class(_timelex)
_tzparser = __deprecate_private_class(_tzparser)
_resultbase = __deprecate_private_class(_resultbase)
_parsetz = __deprecated_private_func(_parsetz)
Reported by Pylint.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
from ._parser import parse, parser, parserinfo, ParserError
from ._parser import DEFAULTPARSER, DEFAULTTZPARSER
from ._parser import UnknownTimezoneWarning
from ._parser import __doc__
from .isoparser import isoparser, isoparse
Reported by Pylint.
Line: 21
Column: 1
# is improperly relying on it is given *some* notice.
def __deprecated_private_func(f):
from functools import wraps
import warnings
msg = ('{name} is a private function and may break without warning, '
'it will be moved and or renamed in future versions.')
Reported by Pylint.
Line: 22
Column: 5
def __deprecated_private_func(f):
from functools import wraps
import warnings
msg = ('{name} is a private function and may break without warning, '
'it will be moved and or renamed in future versions.')
msg = msg.format(name=f.__name__)
Reported by Pylint.
pipenv/vendor/jinja2/nativetypes.py
19 issues
Line: 6
Column: 1
from itertools import chain
from itertools import islice
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
from .environment import Template
Reported by Pylint.
Line: 7
Column: 1
from itertools import islice
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
from .environment import Template
Reported by Pylint.
Line: 8
Column: 1
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
from .environment import Template
Reported by Pylint.
Line: 9
Column: 1
from . import nodes
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
from .environment import Template
def native_concat(values: t.Iterable[t.Any]) -> t.Optional[t.Any]:
Reported by Pylint.
Line: 10
Column: 1
from .compiler import CodeGenerator
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
from .environment import Template
def native_concat(values: t.Iterable[t.Any]) -> t.Optional[t.Any]:
"""Return a native Python type from the list of compiled nodes. If
Reported by Pylint.
Line: 11
Column: 1
from .compiler import Frame
from .compiler import has_safe_repr
from .environment import Environment
from .environment import Template
def native_concat(values: t.Iterable[t.Any]) -> t.Optional[t.Any]:
"""Return a native Python type from the list of compiled nodes. If
the result is a single node, its value is returned. Otherwise, the
Reported by Pylint.
Line: 67
Column: 33
return finalize.const(const) # type: ignore
def _output_child_pre(
self, node: nodes.Expr, frame: Frame, finalize: CodeGenerator._FinalizeInfo
) -> None:
if finalize.src is not None:
self.write(finalize.src)
def _output_child_post(
Reported by Pylint.
Line: 67
Column: 15
return finalize.const(const) # type: ignore
def _output_child_pre(
self, node: nodes.Expr, frame: Frame, finalize: CodeGenerator._FinalizeInfo
) -> None:
if finalize.src is not None:
self.write(finalize.src)
def _output_child_post(
Reported by Pylint.
Line: 73
Column: 33
self.write(finalize.src)
def _output_child_post(
self, node: nodes.Expr, frame: Frame, finalize: CodeGenerator._FinalizeInfo
) -> None:
if finalize.src is not None:
self.write(")")
Reported by Pylint.
Line: 73
Column: 15
self.write(finalize.src)
def _output_child_post(
self, node: nodes.Expr, frame: Frame, finalize: CodeGenerator._FinalizeInfo
) -> None:
if finalize.src is not None:
self.write(")")
Reported by Pylint.
pipenv/patched/notpip/_vendor/pytoml/writer.py
19 issues
Line: 4
Column: 1
from __future__ import unicode_literals
import io, datetime, math, string, sys
from .utils import format_rfc3339
try:
from pathlib import PurePath as _path_types
except ImportError:
_path_types = ()
Reported by Pylint.
Line: 1
Column: 1
from __future__ import unicode_literals
import io, datetime, math, string, sys
from .utils import format_rfc3339
try:
from pathlib import PurePath as _path_types
except ImportError:
_path_types = ()
Reported by Pylint.
Line: 2
Column: 1
from __future__ import unicode_literals
import io, datetime, math, string, sys
from .utils import format_rfc3339
try:
from pathlib import PurePath as _path_types
except ImportError:
_path_types = ()
Reported by Pylint.
Line: 13
Column: 5
if sys.version_info[0] == 3:
long = int
unicode = str
def dumps(obj, sort_keys=False):
fout = io.StringIO()
Reported by Pylint.
Line: 14
Column: 5
if sys.version_info[0] == 3:
long = int
unicode = str
def dumps(obj, sort_keys=False):
fout = io.StringIO()
dump(obj, fout, sort_keys=sort_keys)
Reported by Pylint.
Line: 17
Column: 1
unicode = str
def dumps(obj, sort_keys=False):
fout = io.StringIO()
dump(obj, fout, sort_keys=sort_keys)
return fout.getvalue()
Reported by Pylint.
Line: 26
Column: 1
_escapes = {'\n': 'n', '\r': 'r', '\\': '\\', '\t': 't', '\b': 'b', '\f': 'f', '"': '"'}
def _escape_string(s):
res = []
start = 0
def flush():
if start != i:
Reported by Pylint.
Line: 37
Column: 9
i = 0
while i < len(s):
c = s[i]
if c in '"\\\n\r\t\b\f':
start = flush()
res.append('\\' + _escapes[c])
elif ord(c) < 0x20:
start = flush()
Reported by Pylint.
Line: 51
Column: 1
_key_chars = string.digits + string.ascii_letters + '-_'
def _escape_id(s):
if any(c not in _key_chars for c in s):
return _escape_string(s)
return s
Reported by Pylint.
Line: 57
Column: 1
return s
def _format_value(v):
if isinstance(v, bool):
return 'true' if v else 'false'
if isinstance(v, int) or isinstance(v, long):
return unicode(v)
if isinstance(v, float):
Reported by Pylint.
pipenv/vendor/importlib_resources/simple.py
19 issues
Line: 10
Column: 1
import itertools
from typing import BinaryIO, List
from .abc import Traversable, TraversableResources
class SimpleReader(abc.ABC):
"""
The minimum, low-level interface required from a resource
Reported by Pylint.
Line: 69
Column: 5
def is_dir(self):
return False
def open(self, mode='r', *args, **kwargs):
stream = self.parent.reader.open_binary(self.name)
if 'b' not in mode:
stream = io.TextIOWrapper(*args, **kwargs)
return stream
Reported by Pylint.
Line: 49
Column: 5
"""
@property
def name(self):
return self.package.split('.')[-1]
class ResourceHandle(Traversable):
"""
Reported by Pylint.
Line: 63
Column: 5
self.parent = parent
self.name = name # type: ignore
def is_file(self):
return True
def is_dir(self):
return False
Reported by Pylint.
Line: 63
Column: 5
self.parent = parent
self.name = name # type: ignore
def is_file(self):
return True
def is_dir(self):
return False
Reported by Pylint.
Line: 66
Column: 5
def is_file(self):
return True
def is_dir(self):
return False
def open(self, mode='r', *args, **kwargs):
stream = self.parent.reader.open_binary(self.name)
if 'b' not in mode:
Reported by Pylint.
Line: 66
Column: 5
def is_file(self):
return True
def is_dir(self):
return False
def open(self, mode='r', *args, **kwargs):
stream = self.parent.reader.open_binary(self.name)
if 'b' not in mode:
Reported by Pylint.
Line: 69
Column: 5
def is_dir(self):
return False
def open(self, mode='r', *args, **kwargs):
stream = self.parent.reader.open_binary(self.name)
if 'b' not in mode:
stream = io.TextIOWrapper(*args, **kwargs)
return stream
Reported by Pylint.
Line: 75
Column: 5
stream = io.TextIOWrapper(*args, **kwargs)
return stream
def joinpath(self, name):
raise RuntimeError("Cannot traverse into a resource")
class ResourceContainer(Traversable):
"""
Reported by Pylint.
Line: 75
Column: 5
stream = io.TextIOWrapper(*args, **kwargs)
return stream
def joinpath(self, name):
raise RuntimeError("Cannot traverse into a resource")
class ResourceContainer(Traversable):
"""
Reported by Pylint.
pipenv/vendor/importlib_resources/abc.py
19 issues
Line: 4
Column: 1
import abc
from typing import BinaryIO, Iterable, Text
from ._compat import runtime_checkable, Protocol
class ResourceReader(metaclass=abc.ABCMeta):
"""Abstract base class for loaders to provide resource reading support."""
Reported by Pylint.
Line: 10
Column: 6
class ResourceReader(metaclass=abc.ABCMeta):
"""Abstract base class for loaders to provide resource reading support."""
@abc.abstractmethod
def open_resource(self, resource: Text) -> BinaryIO:
"""Return an opened, file-like object for binary reading.
The 'resource' argument is expected to represent only a file name.
If the resource cannot be found, FileNotFoundError is raised.
Reported by Pylint.
Line: 22
Column: 6
# it'll still do the right thing.
raise FileNotFoundError
@abc.abstractmethod
def resource_path(self, resource: Text) -> Text:
"""Return the file system path to the specified resource.
The 'resource' argument is expected to represent only a file name.
If the resource does not exist on the file system, raise
Reported by Pylint.
Line: 35
Column: 6
# it'll still do the right thing.
raise FileNotFoundError
@abc.abstractmethod
def is_resource(self, path: Text) -> bool:
"""Return True if the named 'path' is a resource.
Files are resources, directories are not.
"""
Reported by Pylint.
Line: 43
Column: 6
"""
raise FileNotFoundError
@abc.abstractmethod
def contents(self) -> Iterable[str]:
"""Return an iterable of entries in `package`."""
raise FileNotFoundError
Reported by Pylint.
Line: 56
Column: 6
traversing directories and opening files.
"""
@abc.abstractmethod
def iterdir(self):
"""
Yield Traversable objects in self
"""
Reported by Pylint.
Line: 76
Column: 6
with self.open(encoding=encoding) as strm:
return strm.read()
@abc.abstractmethod
def is_dir(self) -> bool:
"""
Return True if self is a dir
"""
Reported by Pylint.
Line: 82
Column: 6
Return True if self is a dir
"""
@abc.abstractmethod
def is_file(self) -> bool:
"""
Return True if self is a file
"""
Reported by Pylint.
Line: 88
Column: 6
Return True if self is a file
"""
@abc.abstractmethod
def joinpath(self, child):
"""
Return Traversable child in self
"""
Reported by Pylint.
Line: 100
Column: 6
"""
return self.joinpath(child)
@abc.abstractmethod
def open(self, mode='r', *args, **kwargs):
"""
mode may be 'r' or 'rb' to open as text or binary. Return a handle
suitable for reading (same as pathlib.Path.open).
Reported by Pylint.
pipenv/vendor/plette/models/base.py
19 issues
Line: 105
Column: 16
return len(self._data)
def __getitem__(self, key):
return self.item_class(self._data[key])
def __setitem__(self, key, value):
if isinstance(value, DataView):
value = value._data
self._data[key] = value
Reported by Pylint.
Line: 152
Column: 17
cls.item_class.validate(d)
def __iter__(self):
return (self.item_class(d) for d in self._data)
def __getitem__(self, key):
if isinstance(key, slice):
return type(self)(self._data[key])
return super(DataViewSequence, self).__getitem__(key)
Reported by Pylint.
Line: 161
Column: 21
def append(self, value):
if isinstance(value, DataView):
value = value._data
self._data.append(value)
Reported by Pylint.
Line: 1
Column: 1
try:
import cerberus
except ImportError:
cerberus = None
class ValidationError(ValueError):
def __init__(self, value, validator):
super(ValidationError, self).__init__(value)
Reported by Pylint.
Line: 7
Column: 1
cerberus = None
class ValidationError(ValueError):
def __init__(self, value, validator):
super(ValidationError, self).__init__(value)
self.validator = validator
self.value = value
Reported by Pylint.
Line: 9
Column: 9
class ValidationError(ValueError):
def __init__(self, value, validator):
super(ValidationError, self).__init__(value)
self.validator = validator
self.value = value
def __str__(self):
return '{}\n{}'.format(
Reported by Pylint.
Line: 27
Column: 1
VALIDATORS = {}
def validate(cls, data):
if not cerberus: # Skip validation if Cerberus is not available.
return
schema = cls.__SCHEMA__
key = id(schema)
try:
Reported by Pylint.
Line: 33
Column: 9
schema = cls.__SCHEMA__
key = id(schema)
try:
v = VALIDATORS[key]
except KeyError:
v = VALIDATORS[key] = cerberus.Validator(schema, allow_unknown=True)
if v.validate(data, normalize=False):
return
raise ValidationError(data, v)
Reported by Pylint.
Line: 35
Column: 9
try:
v = VALIDATORS[key]
except KeyError:
v = VALIDATORS[key] = cerberus.Validator(schema, allow_unknown=True)
if v.validate(data, normalize=False):
return
raise ValidationError(data, v)
Reported by Pylint.
Line: 41
Column: 1
raise ValidationError(data, v)
class DataView(object):
"""A "view" to a data.
Validates the input mapping on creation. A subclass is expected to
provide a `__SCHEMA__` class attribute specifying a validator schema.
"""
Reported by Pylint.
pipenv/patched/notpip/_vendor/cachecontrol/caches/file_cache.py
19 issues
Line: 5
Column: 1
import os
from textwrap import dedent
from ..cache import BaseCache
from ..controller import CacheController
try:
FileNotFoundError
except NameError:
Reported by Pylint.
Line: 6
Column: 1
from textwrap import dedent
from ..cache import BaseCache
from ..controller import CacheController
try:
FileNotFoundError
except NameError:
# py2.X
Reported by Pylint.
Line: 32
Column: 18
# On Windows we'll mark this file as binary
if hasattr(os, "O_BINARY"):
flags |= os.O_BINARY
# Before we open our file, we want to delete any existing file that is
# there
try:
os.remove(filename)
Reported by Pylint.
Line: 12
Column: 5
FileNotFoundError
except NameError:
# py2.X
FileNotFoundError = (IOError, OSError)
def _secure_open_write(filename, fmode):
# We only want to write to this file, so open it in write only mode
flags = os.O_WRONLY
Reported by Pylint.
Line: 82
Column: 13
pip install lockfile
"""
)
raise ImportError(notice)
else:
if use_dir_lock:
lock_class = MkdirLockFile
Reported by Pylint.
Line: 146
Column: 12
This does not ensure the file exists!
"""
key = CacheController.cache_url(url)
return filecache._fn(key)
Reported by Pylint.
Line: 1
Column: 1
import hashlib
import os
from textwrap import dedent
from ..cache import BaseCache
from ..controller import CacheController
try:
FileNotFoundError
Reported by Pylint.
Line: 46
Column: 5
# race condition happens between the os.remove and this line, that an
# error will be raised. Because we utilize a lockfile this should only
# happen if someone is attempting to attack us.
fd = os.open(filename, flags, fmode)
try:
return os.fdopen(fd, "wb")
except:
# An error occurred wrapping our FD in a file object
Reported by Pylint.
Line: 56
Column: 1
raise
class FileCache(BaseCache):
def __init__(
self,
directory,
forever=False,
Reported by Pylint.
Line: 58
Column: 5
class FileCache(BaseCache):
def __init__(
self,
directory,
forever=False,
filemode=0o0600,
dirmode=0o0700,
Reported by Pylint.