The following issues were found
tests/unit/test_vendor.py
25 issues
Line: 8
Column: 1
import datetime
import os
import pytest
import pytz
import tomlkit
from pipfile.api import PipfileParser
Reported by Pylint.
Line: 9
Column: 1
import os
import pytest
import pytz
import tomlkit
from pipfile.api import PipfileParser
Reported by Pylint.
Line: 10
Column: 1
import pytest
import pytz
import tomlkit
from pipfile.api import PipfileParser
class TestPipfileParser:
Reported by Pylint.
Line: 12
Column: 1
import pytz
import tomlkit
from pipfile.api import PipfileParser
class TestPipfileParser:
def test_inject_environment_variables(self):
Reported by Pylint.
Line: 3
Column: 1
# We need to import the patched packages directly from sys.path, so the
# identity checks can pass.
import pipenv # noqa
import datetime
import os
import pytest
import pytz
Reported by Pylint.
Line: 1
Column: 1
# We need to import the patched packages directly from sys.path, so the
# identity checks can pass.
import pipenv # noqa
import datetime
import os
import pytest
import pytz
Reported by Pylint.
Line: 5
Column: 1
# identity checks can pass.
import pipenv # noqa
import datetime
import os
import pytest
import pytz
import tomlkit
Reported by Pylint.
Line: 6
Column: 1
import pipenv # noqa
import datetime
import os
import pytest
import pytz
import tomlkit
Reported by Pylint.
Line: 15
Column: 1
from pipfile.api import PipfileParser
class TestPipfileParser:
def test_inject_environment_variables(self):
os.environ['PYTEST_PIPFILE_TEST'] = "XYZ"
p = PipfileParser()
Reported by Pylint.
Line: 15
Column: 1
from pipfile.api import PipfileParser
class TestPipfileParser:
def test_inject_environment_variables(self):
os.environ['PYTEST_PIPFILE_TEST'] = "XYZ"
p = PipfileParser()
Reported by Pylint.
pipenv/vendor/cerberus/utils.py
25 issues
Line: 5
Column: 1
from collections import namedtuple
from cerberus.platform import _int_types, _str_type, Mapping, Sequence, Set
TypeDefinition = namedtuple('TypeDefinition', 'name,included_types,excluded_types')
"""
This class is used to define types that can be used as value in the
Reported by Pylint.
Line: 53
Column: 9
def get_Validator_class():
global Validator
if 'Validator' not in globals():
from cerberus.validator import Validator
return Validator
def mapping_hash(schema):
return hash(mapping_to_frozenset(schema))
Reported by Pylint.
Line: 51
Column: 5
def get_Validator_class():
global Validator
if 'Validator' not in globals():
from cerberus.validator import Validator
return Validator
Reported by Pylint.
Line: 105
Column: 1
raise RuntimeError('This is a readonly class property.')
def validator_factory(name, bases=None, namespace={}):
"""
Dynamically create a :class:`~cerberus.Validator` subclass.
Docstrings of mixin-classes will be added to the resulting class' one if ``__doc__``
is not in :obj:`namespace`.
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
from collections import namedtuple
from cerberus.platform import _int_types, _str_type, Mapping, Sequence, Set
TypeDefinition = namedtuple('TypeDefinition', 'name,included_types,excluded_types')
"""
Reported by Pylint.
Line: 20
Column: 1
"""
def compare_paths_lt(x, y):
min_length = min(len(x), len(y))
if x[:min_length] == y[:min_length]:
return len(x) == min_length
Reported by Pylint.
Line: 20
Column: 1
"""
def compare_paths_lt(x, y):
min_length = min(len(x), len(y))
if x[:min_length] == y[:min_length]:
return len(x) == min_length
Reported by Pylint.
Line: 20
Column: 1
"""
def compare_paths_lt(x, y):
min_length = min(len(x), len(y))
if x[:min_length] == y[:min_length]:
return len(x) == min_length
Reported by Pylint.
Line: 27
Column: 12
return len(x) == min_length
for i in range(min_length):
a, b = x[i], y[i]
for _type in (_int_types, _str_type, tuple):
if isinstance(a, _type):
if isinstance(b, _type):
break
Reported by Pylint.
Line: 27
Column: 9
return len(x) == min_length
for i in range(min_length):
a, b = x[i], y[i]
for _type in (_int_types, _str_type, tuple):
if isinstance(a, _type):
if isinstance(b, _type):
break
Reported by Pylint.
pipenv/vendor/vistir/backports/surrogateescape.py
25 issues
Line: 38
Column: 15
_unichr = chr
bytes_chr = lambda code: bytes((code,))
else:
_unichr = unichr # type: ignore
bytes_chr = chr
def surrogateescape_handler(exc):
"""
Reported by Pylint.
Line: 10
Column: 1
# This code is released under the Python license and the BSD 2-clause license
import codecs
import sys
import six
FS_ERRORS = "surrogateescape"
Reported by Pylint.
Line: 65
Column: 9
else:
raise exc
except NotASurrogateError:
raise exc
return (decoded, exc.end)
class NotASurrogateError(Exception):
pass
Reported by Pylint.
Line: 127
Column: 20
return str().join(decoded)
def encodefilename(fn):
if FS_ENCODING == "ascii":
# ASCII encoder of Python 2 expects that the error handler returns a
# Unicode string encodable to ASCII, whereas our surrogateescape error
# handler has to return bytes in 0x80-0xFF range.
encoded = []
Reported by Pylint.
Line: 132
Column: 9
# ASCII encoder of Python 2 expects that the error handler returns a
# Unicode string encodable to ASCII, whereas our surrogateescape error
# handler has to return bytes in 0x80-0xFF range.
encoded = []
for index, ch in enumerate(fn):
code = ord(ch)
if code < 128:
ch = bytes_chr(code)
elif 0xDC80 <= code <= 0xDCFF:
Reported by Pylint.
Line: 167
Column: 20
return fn.encode(FS_ENCODING, FS_ERRORS)
def decodefilename(fn):
return fn.decode(FS_ENCODING, FS_ERRORS)
FS_ENCODING = "ascii"
fn = b("[abc\xff]")
Reported by Pylint.
Line: 20
Column: 1
# FS_ERRORS = 'my_surrogateescape'
def u(text):
if six.PY3:
return text
else:
return text.decode("unicode_escape")
Reported by Pylint.
Line: 20
Column: 1
# FS_ERRORS = 'my_surrogateescape'
def u(text):
if six.PY3:
return text
else:
return text.decode("unicode_escape")
Reported by Pylint.
Line: 21
Column: 5
def u(text):
if six.PY3:
return text
else:
return text.decode("unicode_escape")
Reported by Pylint.
Line: 27
Column: 1
return text.decode("unicode_escape")
def b(data):
if six.PY3:
return data.encode("latin1")
else:
return data
Reported by Pylint.
pipenv/patched/notpip/_vendor/packaging/tags.py
25 issues
Line: 25
Column: 1
import sysconfig
import warnings
from ._typing import MYPY_CHECK_RUNNING, cast
if MYPY_CHECK_RUNNING: # pragma: no cover
from typing import (
Dict,
FrozenSet,
Reported by Pylint.
Line: 64
Column: 42
__slots__ = ["_interpreter", "_abi", "_platform"]
def __init__(self, interpreter, abi, platform):
# type: (str, str, str) -> None
self._interpreter = interpreter.lower()
self._abi = abi.lower()
self._platform = platform.lower()
Reported by Pylint.
Line: 366
Column: 3
formats.extend(["intel", "fat32", "fat"])
elif cpu_arch == "ppc64":
# TODO: Need to care about 32-bit PPC for ppc64 through 10.2?
if version > (10, 5) or version < (10, 4):
return []
formats.append("fat64")
elif cpu_arch == "ppc":
Reported by Pylint.
Line: 394
Column: 9
if version is None:
version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2])))
else:
version = version
if arch is None:
arch = _mac_arch(cpu_arch)
else:
arch = arch
for minor_version in range(version[1], -1, -1):
Reported by Pylint.
Line: 398
Column: 9
if arch is None:
arch = _mac_arch(cpu_arch)
else:
arch = arch
for minor_version in range(version[1], -1, -1):
compat_version = version[0], minor_version
binary_formats = _mac_binary_formats(compat_version, arch)
for binary_format in binary_formats:
yield "macosx_{major}_{minor}_{binary_format}".format(
Reported by Pylint.
Line: 551
Column: 17
fmt, file.read(struct.calcsize(fmt))
) # type: (int, )
except struct.error:
raise _ELFFileHeader._InvalidELFFileHeader()
return result
self.e_ident_magic = unpack(">I")
if self.e_ident_magic != self.ELF_MAGIC_NUMBER:
raise _ELFFileHeader._InvalidELFFileHeader()
Reported by Pylint.
Line: 591
Column: 42
try:
with open(sys.executable, "rb") as f:
elf_header = _ELFFileHeader(f)
except (IOError, OSError, TypeError, _ELFFileHeader._InvalidELFFileHeader):
return None
return elf_header
def _is_linux_armhf():
Reported by Pylint.
Line: 1
Column: 1
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import
import distutils.util
try:
Reported by Pylint.
Line: 60
Column: 1
_32_BIT_INTERPRETER = sys.maxsize <= 2 ** 32
class Tag(object):
__slots__ = ["_interpreter", "_abi", "_platform"]
def __init__(self, interpreter, abi, platform):
# type: (str, str, str) -> None
Reported by Pylint.
Line: 60
Column: 1
_32_BIT_INTERPRETER = sys.maxsize <= 2 ** 32
class Tag(object):
__slots__ = ["_interpreter", "_abi", "_platform"]
def __init__(self, interpreter, abi, platform):
# type: (str, str, str) -> None
Reported by Pylint.
pipenv/vendor/wheel/cli/__init__.py
24 issues
Line: 24
Column: 5
def unpack_f(args):
from .unpack import unpack
unpack(args.wheelfile, args.dest)
def pack_f(args):
from .pack import pack
Reported by Pylint.
Line: 29
Column: 5
def pack_f(args):
from .pack import pack
pack(args.directory, args.dest_dir, args.build_number)
def convert_f(args):
from .convert import convert
Reported by Pylint.
Line: 34
Column: 5
def convert_f(args):
from .convert import convert
convert(args.files, args.dest_dir, args.verbose)
def version_f(args):
from .. import __version__
Reported by Pylint.
Line: 39
Column: 5
def version_f(args):
from .. import __version__
print("wheel %s" % __version__)
def parser():
p = argparse.ArgumentParser()
Reported by Pylint.
Line: 14
Column: 9
def require_pkgresources(name):
try:
import pkg_resources # noqa: F401
except ImportError:
raise RuntimeError("'{0}' needs pkg_resources (part of setuptools).".format(name))
class WheelError(Exception):
Reported by Pylint.
Line: 16
Column: 9
try:
import pkg_resources # noqa: F401
except ImportError:
raise RuntimeError("'{0}' needs pkg_resources (part of setuptools).".format(name))
class WheelError(Exception):
pass
Reported by Pylint.
Line: 38
Column: 15
convert(args.files, args.dest_dir, args.verbose)
def version_f(args):
from .. import __version__
print("wheel %s" % __version__)
def parser():
Reported by Pylint.
Line: 12
Column: 1
import sys
def require_pkgresources(name):
try:
import pkg_resources # noqa: F401
except ImportError:
raise RuntimeError("'{0}' needs pkg_resources (part of setuptools).".format(name))
Reported by Pylint.
Line: 14
Column: 9
def require_pkgresources(name):
try:
import pkg_resources # noqa: F401
except ImportError:
raise RuntimeError("'{0}' needs pkg_resources (part of setuptools).".format(name))
class WheelError(Exception):
Reported by Pylint.
Line: 19
Column: 1
raise RuntimeError("'{0}' needs pkg_resources (part of setuptools).".format(name))
class WheelError(Exception):
pass
def unpack_f(args):
from .unpack import unpack
Reported by Pylint.
pipenv/patched/notpip/_internal/utils/compat.py
24 issues
Line: 145
Column: 5
output_encoding = getattr(getattr(sys, "__stderr__", None),
"encoding", None)
if output_encoding:
output_encoded = decoded_data.encode(
output_encoding,
errors="backslashreplace"
)
decoded_data = output_encoded.decode(output_encoding)
Reported by Pylint.
Line: 253
Column: 20
'hh',
fcntl.ioctl(fd, termios.TIOCGWINSZ, '12345678')
)
except Exception:
return None
if cr == (0, 0):
return None
return cr
cr = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2)
Reported by Pylint.
Line: 265
Column: 24
fd = os.open(os.ctermid(), os.O_RDONLY)
cr = ioctl_GWINSZ(fd)
os.close(fd)
except Exception:
pass
if not cr:
cr = (os.environ.get('LINES', 25), os.environ.get('COLUMNS', 80))
return int(cr[1]), int(cr[0])
Reported by Pylint.
Line: 49
Column: 9
cache_from_source = imp.cache_from_source # type: ignore
except AttributeError:
# does not use __pycache__
cache_from_source = None
uses_pycache = cache_from_source is not None
else:
uses_pycache = True
from importlib.util import cache_from_source
Reported by Pylint.
Line: 53
Column: 5
uses_pycache = cache_from_source is not None
else:
uses_pycache = True
from importlib.util import cache_from_source
if PY2:
# In Python 2.7, backslashreplace exists
Reported by Pylint.
Line: 63
Column: 5
# We implement our own replace handler for this
# situation, so that we can consistently use
# backslash replacement for all versions.
def backslashreplace_decode_fn(err):
raw_bytes = (err.object[i] for i in range(err.start, err.end))
# Python 2 gave us characters - convert to numeric bytes
raw_bytes = (ord(b) for b in raw_bytes)
return u"".join(u"\\x%x" % c for c in raw_bytes), err.end
codecs.register_error(
Reported by Pylint.
Line: 72
Column: 5
"backslashreplace_decode",
backslashreplace_decode_fn,
)
backslashreplace_decode = "backslashreplace_decode"
else:
backslashreplace_decode = "backslashreplace"
def has_tls():
Reported by Pylint.
Line: 74
Column: 5
)
backslashreplace_decode = "backslashreplace_decode"
else:
backslashreplace_decode = "backslashreplace"
def has_tls():
# type: () -> bool
try:
Reported by Pylint.
Line: 77
Column: 1
backslashreplace_decode = "backslashreplace"
def has_tls():
# type: () -> bool
try:
import _ssl # noqa: F401 # ignore unused
return True
except ImportError:
Reported by Pylint.
Line: 80
Column: 9
def has_tls():
# type: () -> bool
try:
import _ssl # noqa: F401 # ignore unused
return True
except ImportError:
pass
from pipenv.patched.notpip._vendor.urllib3.util import IS_PYOPENSSL
Reported by Pylint.
pipenv/vendor/importlib_resources/readers.py
24 issues
Line: 5
Column: 1
import pathlib
import operator
from . import abc
from ._itertools import unique_everseen
from ._compat import ZipPath
Reported by Pylint.
Line: 7
Column: 1
from . import abc
from ._itertools import unique_everseen
from ._compat import ZipPath
def remove_duplicates(items):
return iter(collections.OrderedDict.fromkeys(items))
Reported by Pylint.
Line: 8
Column: 1
from . import abc
from ._itertools import unique_everseen
from ._compat import ZipPath
def remove_duplicates(items):
return iter(collections.OrderedDict.fromkeys(items))
Reported by Pylint.
Line: 41
Column: 13
try:
return super().open_resource(resource)
except KeyError as exc:
raise FileNotFoundError(exc.args[0])
def is_resource(self, path):
# workaround for `zipfile.Path.is_file` returning true
# for non-existent paths.
target = self.files().joinpath(path)
Reported by Pylint.
Line: 1
Column: 1
import collections
import pathlib
import operator
from . import abc
from ._itertools import unique_everseen
from ._compat import ZipPath
Reported by Pylint.
Line: 11
Column: 1
from ._compat import ZipPath
def remove_duplicates(items):
return iter(collections.OrderedDict.fromkeys(items))
class FileReader(abc.TraversableResources):
def __init__(self, loader):
Reported by Pylint.
Line: 15
Column: 1
return iter(collections.OrderedDict.fromkeys(items))
class FileReader(abc.TraversableResources):
def __init__(self, loader):
self.path = pathlib.Path(loader.path).parent
def resource_path(self, resource):
"""
Reported by Pylint.
Line: 27
Column: 5
"""
return str(self.path.joinpath(resource))
def files(self):
return self.path
class ZipReader(abc.TraversableResources):
def __init__(self, loader, module):
Reported by Pylint.
Line: 31
Column: 1
return self.path
class ZipReader(abc.TraversableResources):
def __init__(self, loader, module):
_, _, name = module.rpartition('.')
self.prefix = loader.prefix.replace('\\', '/') + name + '/'
self.archive = loader.archive
Reported by Pylint.
Line: 37
Column: 5
self.prefix = loader.prefix.replace('\\', '/') + name + '/'
self.archive = loader.archive
def open_resource(self, resource):
try:
return super().open_resource(resource)
except KeyError as exc:
raise FileNotFoundError(exc.args[0])
Reported by Pylint.
pipenv/vendor/tomlkit/_compat.py
24 issues
Line: 144
Column: 15
PY38 = sys.version_info >= (3, 8)
if PY2:
unicode = unicode
chr = unichr
long = long
else:
unicode = str
chr = chr
Reported by Pylint.
Line: 145
Column: 11
if PY2:
unicode = unicode
chr = unichr
long = long
else:
unicode = str
chr = chr
long = int
Reported by Pylint.
Line: 146
Column: 12
if PY2:
unicode = unicode
chr = unichr
long = long
else:
unicode = str
chr = chr
long = int
Reported by Pylint.
Line: 1
Column: 1
import re
import sys
try:
from datetime import timezone
except ImportError:
from datetime import datetime
from datetime import timedelta
Reported by Pylint.
Line: 38
Column: 13
@classmethod
def _create(cls, offset, name=None):
self = tzinfo.__new__(cls)
self._offset = offset
self._name = name
return self
def __getinitargs__(self):
"""pickle support"""
Reported by Pylint.
Line: 39
Column: 13
def _create(cls, offset, name=None):
self = tzinfo.__new__(cls)
self._offset = offset
self._name = name
return self
def __getinitargs__(self):
"""pickle support"""
if self._name is None:
Reported by Pylint.
Line: 134
Column: 20
return "UTC{}{:02d}:{:02d}:{:02d}".format(sign, hours, minutes, seconds)
return "UTC{}{:02d}:{:02d}".format(sign, hours, minutes)
timezone.utc = timezone._create(timedelta(0))
timezone.min = timezone._create(timezone._minoffset)
timezone.max = timezone._create(timezone._maxoffset)
PY2 = sys.version_info[0] == 2
Reported by Pylint.
Line: 135
Column: 20
return "UTC{}{:02d}:{:02d}".format(sign, hours, minutes)
timezone.utc = timezone._create(timedelta(0))
timezone.min = timezone._create(timezone._minoffset)
timezone.max = timezone._create(timezone._maxoffset)
PY2 = sys.version_info[0] == 2
PY36 = sys.version_info >= (3, 6)
Reported by Pylint.
Line: 135
Column: 37
return "UTC{}{:02d}:{:02d}".format(sign, hours, minutes)
timezone.utc = timezone._create(timedelta(0))
timezone.min = timezone._create(timezone._minoffset)
timezone.max = timezone._create(timezone._maxoffset)
PY2 = sys.version_info[0] == 2
PY36 = sys.version_info >= (3, 6)
Reported by Pylint.
Line: 136
Column: 20
timezone.utc = timezone._create(timedelta(0))
timezone.min = timezone._create(timezone._minoffset)
timezone.max = timezone._create(timezone._maxoffset)
PY2 = sys.version_info[0] == 2
PY36 = sys.version_info >= (3, 6)
PY38 = sys.version_info >= (3, 8)
Reported by Pylint.
pipenv/patched/notpip/_vendor/chardet/sbcharsetprober.py
24 issues
Line: 29
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import CharacterCategory, ProbingState, SequenceLikelihood
class SingleByteCharSetProber(CharSetProber):
SAMPLE_SIZE = 64
Reported by Pylint.
Line: 30
Column: 1
######################### END LICENSE BLOCK #########################
from .charsetprober import CharSetProber
from .enums import CharacterCategory, ProbingState, SequenceLikelihood
class SingleByteCharSetProber(CharSetProber):
SAMPLE_SIZE = 64
SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2
Reported by Pylint.
Line: 39
Column: 31
POSITIVE_SHORTCUT_THRESHOLD = 0.95
NEGATIVE_SHORTCUT_THRESHOLD = 0.05
def __init__(self, model, reversed=False, name_prober=None):
super(SingleByteCharSetProber, self).__init__()
self._model = model
# TRUE if we need to reverse every pair in the model lookup
self._reversed = reversed
# Optional auxiliary prober for name decision
Reported by Pylint.
Line: 84
Column: 3
return self.state
char_to_order_map = self._model['char_to_order_map']
for i, c in enumerate(byte_str):
# XXX: Order is in range 1-64, so one would think we want 0-63 here,
# but that leads to 27 more test failures than before.
order = char_to_order_map[c]
# XXX: This was SYMBOL_CAT_ORDER before, with a value of 250, but
# CharacterCategory.SYMBOL is actually 253, so we use CONTROL
# to make it closer to the original intent. The only difference
Reported by Pylint.
Line: 87
Column: 3
# XXX: Order is in range 1-64, so one would think we want 0-63 here,
# but that leads to 27 more test failures than before.
order = char_to_order_map[c]
# XXX: This was SYMBOL_CAT_ORDER before, with a value of 250, but
# CharacterCategory.SYMBOL is actually 253, so we use CONTROL
# to make it closer to the original intent. The only difference
# is whether or not we count digits and control characters for
# _total_char purposes.
if order < CharacterCategory.CONTROL:
Reported by Pylint.
Line: 114
Column: 21
if confidence > self.POSITIVE_SHORTCUT_THRESHOLD:
self.logger.debug('%s confidence = %s, we have a winner',
charset_name, confidence)
self._state = ProbingState.FOUND_IT
elif confidence < self.NEGATIVE_SHORTCUT_THRESHOLD:
self.logger.debug('%s confidence = %s, below negative '
'shortcut threshhold %s', charset_name,
confidence,
self.NEGATIVE_SHORTCUT_THRESHOLD)
Reported by Pylint.
Line: 120
Column: 21
'shortcut threshhold %s', charset_name,
confidence,
self.NEGATIVE_SHORTCUT_THRESHOLD)
self._state = ProbingState.NOT_ME
return self.state
def get_confidence(self):
r = 0.01
Reported by Pylint.
Line: 1
Column: 1
######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Universal charset detector code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2001
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
Reported by Pylint.
Line: 33
Column: 1
from .enums import CharacterCategory, ProbingState, SequenceLikelihood
class SingleByteCharSetProber(CharSetProber):
SAMPLE_SIZE = 64
SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2
POSITIVE_SHORTCUT_THRESHOLD = 0.95
NEGATIVE_SHORTCUT_THRESHOLD = 0.05
Reported by Pylint.
Line: 33
Column: 1
from .enums import CharacterCategory, ProbingState, SequenceLikelihood
class SingleByteCharSetProber(CharSetProber):
SAMPLE_SIZE = 64
SB_ENOUGH_REL_THRESHOLD = 1024 # 0.25 * SAMPLE_SIZE^2
POSITIVE_SHORTCUT_THRESHOLD = 0.95
NEGATIVE_SHORTCUT_THRESHOLD = 0.05
Reported by Pylint.
pipenv/vendor/plette/lockfiles.py
24 issues
Line: 13
Column: 1
import six
from .models import DataView, Meta, PackageCollection
class _LockFileEncoder(json.JSONEncoder):
"""A specilized JSON encoder to convert loaded data into a lock file.
Reported by Pylint.
Line: 29
Column: 5
indent=4, separators=(",", ": "), sort_keys=True,
)
def encode(self, obj):
content = super(_LockFileEncoder, self).encode(obj)
if not isinstance(content, six.text_type):
content = content.decode("utf-8")
content += "\n"
return content
Reported by Pylint.
Line: 36
Column: 5
content += "\n"
return content
def iterencode(self, obj):
for chunk in super(_LockFileEncoder, self).iterencode(obj):
if not isinstance(chunk, six.text_type):
chunk = chunk.decode("utf-8")
yield chunk
yield "\n"
Reported by Pylint.
Line: 94
Column: 40
def with_meta_from(cls, pipfile):
data = {
"_meta": {
"hash": _copy_jsonsafe(pipfile.get_hash()._data),
"pipfile-spec": PIPFILE_SPEC_CURRENT,
"requires": _copy_jsonsafe(pipfile._data.get("requires", {})),
"sources": _copy_jsonsafe(pipfile.sources._data),
},
"default": {},
Reported by Pylint.
Line: 96
Column: 44
"_meta": {
"hash": _copy_jsonsafe(pipfile.get_hash()._data),
"pipfile-spec": PIPFILE_SPEC_CURRENT,
"requires": _copy_jsonsafe(pipfile._data.get("requires", {})),
"sources": _copy_jsonsafe(pipfile.sources._data),
},
"default": {},
"develop": {},
}
Reported by Pylint.
Line: 97
Column: 43
"hash": _copy_jsonsafe(pipfile.get_hash()._data),
"pipfile-spec": PIPFILE_SPEC_CURRENT,
"requires": _copy_jsonsafe(pipfile._data.get("requires", {})),
"sources": _copy_jsonsafe(pipfile.sources._data),
},
"default": {},
"develop": {},
}
return cls(data)
Reported by Pylint.
Line: 134
Column: 13
try:
return self["_meta"]
except KeyError:
raise AttributeError("meta")
@meta.setter
def meta(self, value):
self["_meta"] = value
Reported by Pylint.
Line: 145
Column: 13
try:
return self["_meta"]
except KeyError:
raise AttributeError("meta")
@_meta.setter
def _meta(self, value):
self["_meta"] = value
Reported by Pylint.
Line: 156
Column: 13
try:
return self["default"]
except KeyError:
raise AttributeError("default")
@default.setter
def default(self, value):
self["default"] = value
Reported by Pylint.
Line: 167
Column: 13
try:
return self["develop"]
except KeyError:
raise AttributeError("develop")
@develop.setter
def develop(self, value):
self["develop"] = value
Reported by Pylint.