The following issues were found
pipenv/patched/notpip/_vendor/html5lib/_trie/py.py
10 issues
Line: 6
Column: 1
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import, division, unicode_literals
from pipenv.patched.notpip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
Reported by Pylint.
Line: 4
Column: 1
from __future__ import absolute_import, division, unicode_literals
from pipenv.patched.notpip._vendor.six import text_type
from bisect import bisect_left
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
Reported by Pylint.
Line: 9
Column: 1
from ._base import Trie as ABCTrie
class Trie(ABCTrie):
def __init__(self, data):
if not all(isinstance(x, text_type) for x in data.keys()):
raise TypeError("All keys must be strings")
self._data = data
Reported by Pylint.
Line: 31
Column: 5
def __getitem__(self, key):
return self._data[key]
def keys(self, prefix=None):
if prefix is None or prefix == "" or not self._keys:
return set(self._keys)
if prefix.startswith(self._cachestr):
lo, hi = self._cachepoints
Reported by Pylint.
Line: 36
Column: 13
return set(self._keys)
if prefix.startswith(self._cachestr):
lo, hi = self._cachepoints
start = i = bisect_left(self._keys, prefix, lo, hi)
else:
start = i = bisect_left(self._keys, prefix)
keys = set()
Reported by Pylint.
Line: 36
Column: 17
return set(self._keys)
if prefix.startswith(self._cachestr):
lo, hi = self._cachepoints
start = i = bisect_left(self._keys, prefix, lo, hi)
else:
start = i = bisect_left(self._keys, prefix)
keys = set()
Reported by Pylint.
Line: 54
Column: 5
return keys
def has_keys_with_prefix(self, prefix):
if prefix in self._data:
return True
if prefix.startswith(self._cachestr):
lo, hi = self._cachepoints
Reported by Pylint.
Line: 59
Column: 17
return True
if prefix.startswith(self._cachestr):
lo, hi = self._cachepoints
i = bisect_left(self._keys, prefix, lo, hi)
else:
i = bisect_left(self._keys, prefix)
if i == len(self._keys):
Reported by Pylint.
Line: 59
Column: 13
return True
if prefix.startswith(self._cachestr):
lo, hi = self._cachepoints
i = bisect_left(self._keys, prefix, lo, hi)
else:
i = bisect_left(self._keys, prefix)
if i == len(self._keys):
Reported by Pylint.
pipenv/vendor/distlib/markers.py
10 issues
Line: 19
Column: 1
import sys
import platform
from .compat import string_types
from .util import in_venv, parse_marker
__all__ = ['interpret']
def _is_literal(o):
Reported by Pylint.
Line: 20
Column: 1
import platform
from .compat import string_types
from .util import in_venv, parse_marker
__all__ = ['interpret']
def _is_literal(o):
if not isinstance(o, string_types) or not o:
Reported by Pylint.
Line: 124
Column: 9
try:
expr, rest = parse_marker(marker)
except Exception as e:
raise SyntaxError('Unable to interpret marker syntax: %s: %s' % (marker, e))
if rest and rest[0] != '#':
raise SyntaxError('unexpected trailing data in marker: %s: %s' % (marker, rest))
context = dict(DEFAULT_CONTEXT)
if execution_context:
context.update(execution_context)
Reported by Pylint.
Line: 24
Column: 1
__all__ = ['interpret']
def _is_literal(o):
if not isinstance(o, string_types) or not o:
return False
return o[0] in '\'"'
class Evaluator(object):
Reported by Pylint.
Line: 29
Column: 1
return False
return o[0] in '\'"'
class Evaluator(object):
"""
This class is used to evaluate marker expessions.
"""
operations = {
Reported by Pylint.
Line: 29
Column: 1
return False
return o[0] in '\'"'
class Evaluator(object):
"""
This class is used to evaluate marker expessions.
"""
operations = {
Reported by Pylint.
Line: 62
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
raise SyntaxError('unknown variable: %s' % expr)
result = context[expr]
else:
assert isinstance(expr, dict)
op = expr['op']
if op not in self.operations:
raise NotImplementedError('op not implemented: %s' % op)
elhs = expr['lhs']
erhs = expr['rhs']
Reported by Bandit.
Line: 63
Column: 13
result = context[expr]
else:
assert isinstance(expr, dict)
op = expr['op']
if op not in self.operations:
raise NotImplementedError('op not implemented: %s' % op)
elhs = expr['lhs']
erhs = expr['rhs']
if _is_literal(expr['lhs']) and _is_literal(expr['rhs']):
Reported by Pylint.
Line: 76
Column: 1
result = self.operations[op](lhs, rhs)
return result
def default_context():
def format_full_version(info):
version = '%s.%s.%s' % (info.major, info.minor, info.micro)
kind = info.releaselevel
if kind != 'final':
version += kind[0] + str(info.serial)
Reported by Pylint.
Line: 123
Column: 5
"""
try:
expr, rest = parse_marker(marker)
except Exception as e:
raise SyntaxError('Unable to interpret marker syntax: %s: %s' % (marker, e))
if rest and rest[0] != '#':
raise SyntaxError('unexpected trailing data in marker: %s: %s' % (marker, rest))
context = dict(DEFAULT_CONTEXT)
if execution_context:
Reported by Pylint.
pipenv/patched/yaml3/error.py
10 issues
Line: 50
Column: 5
class MarkedYAMLError(YAMLError):
def __init__(self, context=None, context_mark=None,
problem=None, problem_mark=None, note=None):
self.context = context
self.context_mark = context_mark
self.problem = problem
self.problem_mark = problem_mark
Reported by Pylint.
Line: 1
Column: 1
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark:
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
Reported by Pylint.
Line: 4
Column: 1
__all__ = ['Mark', 'YAMLError', 'MarkedYAMLError']
class Mark:
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
Reported by Pylint.
Line: 6
Column: 5
class Mark:
def __init__(self, name, index, line, column, buffer, pointer):
self.name = name
self.index = index
self.line = line
self.column = column
self.buffer = buffer
Reported by Pylint.
Line: 14
Column: 5
self.buffer = buffer
self.pointer = pointer
def get_snippet(self, indent=4, max_length=75):
if self.buffer is None:
return None
head = ''
start = self.pointer
while start > 0 and self.buffer[start-1] not in '\0\r\n\x85\u2028\u2029':
Reported by Pylint.
Line: 45
Column: 1
where += ":\n"+snippet
return where
class YAMLError(Exception):
pass
class MarkedYAMLError(YAMLError):
def __init__(self, context=None, context_mark=None,
Reported by Pylint.
Line: 48
Column: 1
class YAMLError(Exception):
pass
class MarkedYAMLError(YAMLError):
def __init__(self, context=None, context_mark=None,
problem=None, problem_mark=None, note=None):
self.context = context
self.context_mark = context_mark
Reported by Pylint.
Line: 50
Column: 5
class MarkedYAMLError(YAMLError):
def __init__(self, context=None, context_mark=None,
problem=None, problem_mark=None, note=None):
self.context = context
self.context_mark = context_mark
self.problem = problem
self.problem_mark = problem_mark
Reported by Pylint.
Line: 62
Column: 12
lines = []
if self.context is not None:
lines.append(self.context)
if self.context_mark is not None \
and (self.problem is None or self.problem_mark is None
or self.context_mark.name != self.problem_mark.name
or self.context_mark.line != self.problem_mark.line
or self.context_mark.column != self.problem_mark.column):
lines.append(str(self.context_mark))
Reported by Pylint.
Line: 75
Column: 1
if self.note is not None:
lines.append(self.note)
return '\n'.join(lines)
Reported by Pylint.
pipenv/patched/notpip/_vendor/webencodings/x_user_defined.py
10 issues
Line: 23
Column: 22
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(self, input, errors='strict'):
return codecs.charmap_decode(input, errors, decoding_table)
Reported by Pylint.
Line: 26
Column: 22
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(self, input, errors='strict'):
return codecs.charmap_decode(input, errors, decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
Reported by Pylint.
Line: 31
Column: 22
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.charmap_encode(input, self.errors, encoding_table)[0]
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
Reported by Pylint.
Line: 36
Column: 22
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
return codecs.charmap_decode(input, self.errors, decoding_table)[0]
class StreamWriter(Codec, codecs.StreamWriter):
pass
Reported by Pylint.
Line: 21
Column: 1
### Codec APIs
class Codec(codecs.Codec):
def encode(self, input, errors='strict'):
return codecs.charmap_encode(input, errors, encoding_table)
def decode(self, input, errors='strict'):
Reported by Pylint.
Line: 30
Column: 1
return codecs.charmap_decode(input, errors, decoding_table)
class IncrementalEncoder(codecs.IncrementalEncoder):
def encode(self, input, final=False):
return codecs.charmap_encode(input, self.errors, encoding_table)[0]
class IncrementalDecoder(codecs.IncrementalDecoder):
Reported by Pylint.
Line: 35
Column: 1
return codecs.charmap_encode(input, self.errors, encoding_table)[0]
class IncrementalDecoder(codecs.IncrementalDecoder):
def decode(self, input, final=False):
return codecs.charmap_decode(input, self.errors, decoding_table)[0]
class StreamWriter(Codec, codecs.StreamWriter):
Reported by Pylint.
Line: 40
Column: 1
return codecs.charmap_decode(input, self.errors, decoding_table)[0]
class StreamWriter(Codec, codecs.StreamWriter):
pass
class StreamReader(Codec, codecs.StreamReader):
pass
Reported by Pylint.
Line: 44
Column: 1
pass
class StreamReader(Codec, codecs.StreamReader):
pass
### encodings module API
Reported by Pylint.
Line: 65
Column: 1
# Python 3:
# for c in range(256): print(' %r' % chr(c if c < 128 else c + 0xF700))
decoding_table = (
'\x00'
'\x01'
'\x02'
'\x03'
'\x04'
Reported by Pylint.
pipenv/patched/notpip/_internal/operations/freeze.py
10 issues
Line: 1
Column: 1
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import collections
import logging
import os
Reported by Pylint.
Line: 43
Column: 1
logger = logging.getLogger(__name__)
def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=None, # type: Optional[bool]
user_only=None, # type: Optional[bool]
paths=None, # type: Optional[List[str]]
Reported by Pylint.
Line: 43
Column: 1
logger = logging.getLogger(__name__)
def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=None, # type: Optional[bool]
user_only=None, # type: Optional[bool]
paths=None, # type: Optional[List[str]]
Reported by Pylint.
Line: 43
Column: 1
logger = logging.getLogger(__name__)
def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=None, # type: Optional[bool]
user_only=None, # type: Optional[bool]
paths=None, # type: Optional[List[str]]
Reported by Pylint.
Line: 43
Column: 1
logger = logging.getLogger(__name__)
def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=None, # type: Optional[bool]
user_only=None, # type: Optional[bool]
paths=None, # type: Optional[List[str]]
Reported by Pylint.
Line: 43
Column: 1
logger = logging.getLogger(__name__)
def freeze(
requirement=None, # type: Optional[List[str]]
find_links=None, # type: Optional[List[str]]
local_only=None, # type: Optional[bool]
user_only=None, # type: Optional[bool]
paths=None, # type: Optional[List[str]]
Reported by Pylint.
Line: 192
Column: 5
location = os.path.normcase(os.path.abspath(dist.location))
from pipenv.patched.notpip._internal.vcs import vcs, RemoteNotFoundError
vcs_backend = vcs.get_backend_for_dir(location)
if vcs_backend is None:
req = dist.as_requirement()
logger.debug(
Reported by Pylint.
Line: 243
Column: 1
return (None, False, comments)
class FrozenRequirement(object):
def __init__(self, name, req, editable, comments=()):
# type: (str, Union[str, Requirement], bool, Iterable[str]) -> None
self.name = name
self.canonical_name = canonicalize_name(name)
self.req = req
Reported by Pylint.
Line: 243
Column: 1
return (None, False, comments)
class FrozenRequirement(object):
def __init__(self, name, req, editable, comments=()):
# type: (str, Union[str, Requirement], bool, Iterable[str]) -> None
self.name = name
self.canonical_name = canonicalize_name(name)
self.req = req
Reported by Pylint.
Line: 253
Column: 5
self.comments = comments
@classmethod
def from_dist(cls, dist):
# type: (Distribution) -> FrozenRequirement
req, editable, comments = get_requirement_info(dist)
if req is None:
req = dist.as_requirement()
Reported by Pylint.
pipenv/patched/notpip/_vendor/urllib3/_collections.py
10 issues
Line: 20
Column: 1
from collections import OrderedDict
from .exceptions import InvalidHeader
from .packages.six import iterkeys, itervalues, PY3
__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]
Reported by Pylint.
Line: 21
Column: 1
from collections import OrderedDict
from .exceptions import InvalidHeader
from .packages.six import iterkeys, itervalues, PY3
__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]
Reported by Pylint.
Line: 291
Column: 9
def copy(self):
clone = type(self)()
clone._copy_from(self)
return clone
def iteritems(self):
"""Iterate over all header lines, including duplicate ones."""
for key in self:
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
try:
from collections.abc import Mapping, MutableMapping
except ImportError:
from collections import Mapping, MutableMapping
try:
from threading import RLock
except ImportError: # Platform-specific: No threads available
Reported by Pylint.
Line: 11
Column: 5
from threading import RLock
except ImportError: # Platform-specific: No threads available
class RLock:
def __enter__(self):
pass
def __exit__(self, exc_type, exc_value, traceback):
pass
Reported by Pylint.
Line: 19
Column: 1
pass
from collections import OrderedDict
from .exceptions import InvalidHeader
from .packages.six import iterkeys, itervalues, PY3
__all__ = ["RecentlyUsedContainer", "HTTPHeaderDict"]
Reported by Pylint.
Line: 141
Column: 9
"""
def __init__(self, headers=None, **kwargs):
super(HTTPHeaderDict, self).__init__()
self._container = OrderedDict()
if headers is not None:
if isinstance(headers, HTTPHeaderDict):
self._copy_from(headers)
else:
Reported by Pylint.
Line: 208
Column: 5
del self[key]
return value
def discard(self, key):
try:
del self[key]
except KeyError:
pass
Reported by Pylint.
Line: 289
Column: 5
val = list(val)
self._container[key.lower()] = [key] + val
def copy(self):
clone = type(self)()
clone._copy_from(self)
return clone
def iteritems(self):
Reported by Pylint.
Line: 321
Column: 17
for line in message.headers:
if line.startswith(obs_fold_continued_leaders):
if not headers:
# We received a header line that starts with OWS as described
# in RFC-7230 S3.2.4. This indicates a multiline header, but
# there exists no previous header to which we can attach it.
raise InvalidHeader(
"Header continuation with no previous header: %s" % line
Reported by Pylint.
pipenv/patched/notpip/_vendor/pep517/compat.py
10 issues
Line: 32
Column: 5
# FileNotFoundError
try:
FileNotFoundError = FileNotFoundError
except NameError:
FileNotFoundError = IOError
Reported by Pylint.
Line: 32
Column: 5
# FileNotFoundError
try:
FileNotFoundError = FileNotFoundError
except NameError:
FileNotFoundError = IOError
Reported by Pylint.
Line: 10
Column: 5
if sys.version_info[0] >= 3:
# Python 3
def write_json(obj, path, **kwargs):
with open(path, 'w', encoding='utf-8') as f:
json.dump(obj, f, **kwargs)
def read_json(path):
with open(path, 'r', encoding='utf-8') as f:
Reported by Pylint.
Line: 11
Column: 51
if sys.version_info[0] >= 3:
# Python 3
def write_json(obj, path, **kwargs):
with open(path, 'w', encoding='utf-8') as f:
json.dump(obj, f, **kwargs)
def read_json(path):
with open(path, 'r', encoding='utf-8') as f:
return json.load(f)
Reported by Pylint.
Line: 14
Column: 5
with open(path, 'w', encoding='utf-8') as f:
json.dump(obj, f, **kwargs)
def read_json(path):
with open(path, 'r', encoding='utf-8') as f:
return json.load(f)
else:
# Python 2
Reported by Pylint.
Line: 15
Column: 51
json.dump(obj, f, **kwargs)
def read_json(path):
with open(path, 'r', encoding='utf-8') as f:
return json.load(f)
else:
# Python 2
def write_json(obj, path, **kwargs):
Reported by Pylint.
Line: 20
Column: 5
else:
# Python 2
def write_json(obj, path, **kwargs):
with open(path, 'wb') as f:
json.dump(obj, f, encoding='utf-8', **kwargs)
def read_json(path):
with open(path, 'rb') as f:
Reported by Pylint.
Line: 21
Column: 34
else:
# Python 2
def write_json(obj, path, **kwargs):
with open(path, 'wb') as f:
json.dump(obj, f, encoding='utf-8', **kwargs)
def read_json(path):
with open(path, 'rb') as f:
return json.load(f)
Reported by Pylint.
Line: 24
Column: 5
with open(path, 'wb') as f:
json.dump(obj, f, encoding='utf-8', **kwargs)
def read_json(path):
with open(path, 'rb') as f:
return json.load(f)
# FileNotFoundError
Reported by Pylint.
Line: 25
Column: 34
json.dump(obj, f, encoding='utf-8', **kwargs)
def read_json(path):
with open(path, 'rb') as f:
return json.load(f)
# FileNotFoundError
Reported by Pylint.
pipenv/vendor/dateutil/_common.py
10 issues
Line: 9
Column: 24
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __call__(self, n):
if n == self.n:
Reported by Pylint.
Line: 6
Column: 1
"""
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
Reported by Pylint.
Line: 6
Column: 1
"""
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
Reported by Pylint.
Line: 6
Column: 1
"""
class weekday(object):
__slots__ = ["weekday", "n"]
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
Reported by Pylint.
Line: 11
Column: 9
def __init__(self, weekday, n=None):
self.weekday = weekday
self.n = n
def __call__(self, n):
if n == self.n:
return self
else:
Reported by Pylint.
Line: 13
Column: 5
self.weekday = weekday
self.n = n
def __call__(self, n):
if n == self.n:
return self
else:
return self.__class__(self.weekday, n)
Reported by Pylint.
Line: 14
Column: 9
self.n = n
def __call__(self, n):
if n == self.n:
return self
else:
return self.__class__(self.weekday, n)
def __eq__(self, other):
Reported by Pylint.
Line: 34
Column: 1
))
def __ne__(self, other):
return not (self == other)
def __repr__(self):
s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]
if not self.n:
return s
Reported by Pylint.
Line: 37
Column: 9
return not (self == other)
def __repr__(self):
s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]
if not self.n:
return s
else:
return "%s(%+d)" % (s, self.n)
Reported by Pylint.
Line: 38
Column: 9
def __repr__(self):
s = ("MO", "TU", "WE", "TH", "FR", "SA", "SU")[self.weekday]
if not self.n:
return s
else:
return "%s(%+d)" % (s, self.n)
# vim:ts=4:sw=4:et
Reported by Pylint.
pipenv/vendor/pip_shims/environment.py
9 issues
Line: 11
Column: 1
import os
def get_base_import_path():
base_import_path = os.environ.get("PIP_SHIMS_BASE_MODULE", "pip")
return base_import_path
BASE_IMPORT_PATH = get_base_import_path()
Reported by Pylint.
Line: 19
Column: 1
BASE_IMPORT_PATH = get_base_import_path()
def get_pip_version(import_path=BASE_IMPORT_PATH):
try:
pip = importlib.import_module(import_path)
except ImportError:
if import_path != "pip":
return get_pip_version(import_path="pip")
Reported by Pylint.
Line: 23
Column: 9
try:
pip = importlib.import_module(import_path)
except ImportError:
if import_path != "pip":
return get_pip_version(import_path="pip")
else:
import subprocess
version = subprocess.check_output(["pip", "--version"])
Reported by Pylint.
Line: 26
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess
if import_path != "pip":
return get_pip_version(import_path="pip")
else:
import subprocess
version = subprocess.check_output(["pip", "--version"])
if version:
version = version.decode("utf-8").split()[1]
return version
Reported by Bandit.
Line: 26
Column: 13
if import_path != "pip":
return get_pip_version(import_path="pip")
else:
import subprocess
version = subprocess.check_output(["pip", "--version"])
if version:
version = version.decode("utf-8").split()[1]
return version
Reported by Pylint.
Line: 28
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b607_start_process_with_partial_path.html
else:
import subprocess
version = subprocess.check_output(["pip", "--version"])
if version:
version = version.decode("utf-8").split()[1]
return version
return "0.0.0"
version = getattr(pip, "__version__", None)
Reported by Bandit.
Line: 28
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b603_subprocess_without_shell_equals_true.html
else:
import subprocess
version = subprocess.check_output(["pip", "--version"])
if version:
version = version.decode("utf-8").split()[1]
return version
return "0.0.0"
version = getattr(pip, "__version__", None)
Reported by Bandit.
Line: 37
Column: 1
return version
def is_type_checking():
try:
from typing import TYPE_CHECKING
except ImportError:
return False
return TYPE_CHECKING
Reported by Pylint.
Line: 39
Column: 9
def is_type_checking():
try:
from typing import TYPE_CHECKING
except ImportError:
return False
return TYPE_CHECKING
Reported by Pylint.
pipenv/patched/notpip/_vendor/msgpack/__init__.py
9 issues
Line: 2
Column: 1
# coding: utf-8
from ._version import version
from .exceptions import *
from collections import namedtuple
class ExtType(namedtuple('ExtType', 'code data')):
"""ExtType represents ext type in msgpack."""
Reported by Pylint.
Line: 3
Column: 1
# coding: utf-8
from ._version import version
from .exceptions import *
from collections import namedtuple
class ExtType(namedtuple('ExtType', 'code data')):
"""ExtType represents ext type in msgpack."""
Reported by Pylint.
Line: 22
Column: 5
import os
if os.environ.get('MSGPACK_PUREPYTHON'):
from .fallback import Packer, unpackb, Unpacker
else:
try:
from ._cmsgpack import Packer, unpackb, Unpacker
except ImportError:
from .fallback import Packer, unpackb, Unpacker
Reported by Pylint.
Line: 1
Column: 1
# coding: utf-8
from ._version import version
from .exceptions import *
from collections import namedtuple
class ExtType(namedtuple('ExtType', 'code data')):
"""ExtType represents ext type in msgpack."""
Reported by Pylint.
Line: 5
Column: 1
from ._version import version
from .exceptions import *
from collections import namedtuple
class ExtType(namedtuple('ExtType', 'code data')):
"""ExtType represents ext type in msgpack."""
def __new__(cls, code, data):
Reported by Pylint.
Line: 20
Column: 1
return super(ExtType, cls).__new__(cls, code, data)
import os
if os.environ.get('MSGPACK_PUREPYTHON'):
from .fallback import Packer, unpackb, Unpacker
else:
try:
from ._cmsgpack import Packer, unpackb, Unpacker
Reported by Pylint.
Line: 20
Column: 1
return super(ExtType, cls).__new__(cls, code, data)
import os
if os.environ.get('MSGPACK_PUREPYTHON'):
from .fallback import Packer, unpackb, Unpacker
else:
try:
from ._cmsgpack import Packer, unpackb, Unpacker
Reported by Pylint.
Line: 30
Column: 1
from .fallback import Packer, unpackb, Unpacker
def pack(o, stream, **kwargs):
"""
Pack object `o` and write it to `stream`
See :class:`Packer` for options.
"""
Reported by Pylint.
Line: 40
Column: 1
stream.write(packer.pack(o))
def packb(o, **kwargs):
"""
Pack object `o` and return packed bytes
See :class:`Packer` for options.
"""
Reported by Pylint.