The following issues were found
pipenv/patched/notpip/_internal/utils/subprocess.py
13 issues
Line: 10
Column: 1
import os
import subprocess
from pipenv.patched.notpip._vendor.six.moves import shlex_quote
from pipenv.patched.notpip._internal.exceptions import InstallationError
from pipenv.patched.notpip._internal.utils.compat import console_to_str, str_to_display
from pipenv.patched.notpip._internal.utils.logging import subprocess_logger
from pipenv.patched.notpip._internal.utils.misc import HiddenText, path_to_display
Reported by Pylint.
Line: 189
Column: 45
proc = subprocess.Popen(
# Convert HiddenText objects to the underlying str.
reveal_command_args(cmd),
stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, cwd=cwd, env=env,
)
proc.stdin.close()
except Exception as exc:
if log_failed_cmd:
Reported by Pylint.
Line: 189
Column: 20
proc = subprocess.Popen(
# Convert HiddenText objects to the underlying str.
reveal_command_args(cmd),
stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, cwd=cwd, env=env,
)
proc.stdin.close()
except Exception as exc:
if log_failed_cmd:
Reported by Pylint.
Line: 190
Column: 20
# Convert HiddenText objects to the underlying str.
reveal_command_args(cmd),
stderr=subprocess.STDOUT, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, cwd=cwd, env=env,
)
proc.stdin.close()
except Exception as exc:
if log_failed_cmd:
subprocess_logger.critical(
Reported by Pylint.
Line: 8
Column: 1
import logging
import os
import subprocess
from pipenv.patched.notpip._vendor.six.moves import shlex_quote
from pipenv.patched.notpip._internal.exceptions import InstallationError
from pipenv.patched.notpip._internal.utils.compat import console_to_str, str_to_display
Reported by Pylint.
Line: 1
Column: 1
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
from __future__ import absolute_import
import logging
import os
import subprocess
Reported by Pylint.
Line: 8
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b404-import-subprocess
import logging
import os
import subprocess
from pipenv.patched.notpip._vendor.six.moves import shlex_quote
from pipenv.patched.notpip._internal.exceptions import InstallationError
from pipenv.patched.notpip._internal.utils.compat import console_to_str, str_to_display
Reported by Bandit.
Line: 117
Column: 1
return msg
def call_subprocess(
cmd, # type: Union[List[str], CommandArgs]
show_stdout=False, # type: bool
cwd=None, # type: Optional[str]
on_returncode='raise', # type: str
extra_ok_returncodes=None, # type: Optional[Iterable[int]]
Reported by Pylint.
Line: 117
Column: 1
return msg
def call_subprocess(
cmd, # type: Union[List[str], CommandArgs]
show_stdout=False, # type: bool
cwd=None, # type: Optional[str]
on_returncode='raise', # type: str
extra_ok_returncodes=None, # type: Optional[Iterable[int]]
Reported by Pylint.
Line: 117
Column: 1
return msg
def call_subprocess(
cmd, # type: Union[List[str], CommandArgs]
show_stdout=False, # type: bool
cwd=None, # type: Optional[str]
on_returncode='raise', # type: str
extra_ok_returncodes=None, # type: Optional[Iterable[int]]
Reported by Pylint.
pipenv/patched/notpip/_internal/utils/pkg_resources.py
13 issues
Line: 34
Column: 30
# type: (str) -> Iterable[str]
return yield_lines(self.get_metadata(name))
def metadata_isdir(self, name):
# type: (str) -> bool
return False
def metadata_listdir(self, name):
# type: (str) -> List[str]
Reported by Pylint.
Line: 38
Column: 32
# type: (str) -> bool
return False
def metadata_listdir(self, name):
# type: (str) -> List[str]
return []
def run_script(self, script_name, namespace):
# type: (str, str) -> None
Reported by Pylint.
Line: 1
Column: 1
from pipenv.patched.notpip._vendor.pkg_resources import yield_lines
from pipenv.patched.notpip._vendor.six import ensure_str
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Dict, Iterable, List
Reported by Pylint.
Line: 10
Column: 1
from typing import Dict, Iterable, List
class DictMetadata(object):
"""IMetadataProvider that reads metadata files from a dictionary.
"""
def __init__(self, metadata):
# type: (Dict[str, bytes]) -> None
self._metadata = metadata
Reported by Pylint.
Line: 17
Column: 5
# type: (Dict[str, bytes]) -> None
self._metadata = metadata
def has_metadata(self, name):
# type: (str) -> bool
return name in self._metadata
def get_metadata(self, name):
# type: (str) -> str
Reported by Pylint.
Line: 21
Column: 5
# type: (str) -> bool
return name in self._metadata
def get_metadata(self, name):
# type: (str) -> str
try:
return ensure_str(self._metadata[name])
except UnicodeDecodeError as e:
# Mirrors handling done in pkg_resources.NullProvider.
Reported by Pylint.
Line: 25
Column: 9
# type: (str) -> str
try:
return ensure_str(self._metadata[name])
except UnicodeDecodeError as e:
# Mirrors handling done in pkg_resources.NullProvider.
e.reason += " in {} file".format(name)
raise
def get_metadata_lines(self, name):
Reported by Pylint.
Line: 30
Column: 5
e.reason += " in {} file".format(name)
raise
def get_metadata_lines(self, name):
# type: (str) -> Iterable[str]
return yield_lines(self.get_metadata(name))
def metadata_isdir(self, name):
# type: (str) -> bool
Reported by Pylint.
Line: 34
Column: 5
# type: (str) -> Iterable[str]
return yield_lines(self.get_metadata(name))
def metadata_isdir(self, name):
# type: (str) -> bool
return False
def metadata_listdir(self, name):
# type: (str) -> List[str]
Reported by Pylint.
Line: 34
Column: 5
# type: (str) -> Iterable[str]
return yield_lines(self.get_metadata(name))
def metadata_isdir(self, name):
# type: (str) -> bool
return False
def metadata_listdir(self, name):
# type: (str) -> List[str]
Reported by Pylint.
pipenv/vendor/iso8601/iso8601.py
13 issues
Line: 22
Column: 19
if sys.version_info >= (3, 0, 0):
_basestring = str
else:
_basestring = basestring
# Adapted from http://delete.me.uk/2005/03/iso8601.html
ISO8601_REGEX = re.compile(
r"""
Reported by Pylint.
Line: 115
Column: 22
def __eq__(self, other):
if isinstance(other, FixedOffset):
return (
(other.__offset == self.__offset)
and
(other.__name == self.__name)
)
return NotImplemented
Reported by Pylint.
Line: 117
Column: 22
return (
(other.__offset == self.__offset)
and
(other.__name == self.__name)
)
return NotImplemented
def __getinitargs__(self):
return (self.__offset_hours, self.__offset_minutes, self.__name)
Reported by Pylint.
Line: 214
Column: 9
tzinfo=tz,
)
except Exception as e:
raise ParseError(e)
Reported by Pylint.
Line: 75
Column: 5
if sys.version_info >= (3, 2, 0):
UTC = datetime.timezone.utc
def FixedOffset(offset_hours, offset_minutes, name):
return datetime.timezone(
datetime.timedelta(
hours=offset_hours, minutes=offset_minutes),
name)
else:
Reported by Pylint.
Line: 75
Column: 5
if sys.version_info >= (3, 2, 0):
UTC = datetime.timezone.utc
def FixedOffset(offset_hours, offset_minutes, name):
return datetime.timezone(
datetime.timedelta(
hours=offset_hours, minutes=offset_minutes),
name)
else:
Reported by Pylint.
Line: 137
Column: 1
return "<FixedOffset %r %r>" % (self.__name, self.__offset)
def to_int(d, key, default_to_zero=False, default=None, required=True):
"""Pull a value from the dict and convert to int
:param default_to_zero: If the value is None or empty, treat it as zero
:param default: If the value is missing in the dict use this default
Reported by Pylint.
Line: 137
Column: 1
return "<FixedOffset %r %r>" % (self.__name, self.__offset)
def to_int(d, key, default_to_zero=False, default=None, required=True):
"""Pull a value from the dict and convert to int
:param default_to_zero: If the value is None or empty, treat it as zero
:param default: If the value is missing in the dict use this default
Reported by Pylint.
Line: 193
Column: 5
"""
if not isinstance(datestring, _basestring):
raise ParseError("Expecting a string %r" % datestring)
m = ISO8601_REGEX.match(datestring)
if not m:
raise ParseError("Unable to parse date string %r" % datestring)
groups = m.groupdict()
tz = parse_timezone(groups, default_timezone=default_timezone)
Reported by Pylint.
Line: 198
Column: 5
raise ParseError("Unable to parse date string %r" % datestring)
groups = m.groupdict()
tz = parse_timezone(groups, default_timezone=default_timezone)
groups["second_fraction"] = int(Decimal("0.%s" % (groups["second_fraction"] or 0)) * Decimal("1000000.0"))
try:
return datetime.datetime(
Reported by Pylint.
pipenv/vendor/urllib3/util/connection.py
13 issues
Line: 7
Column: 1
from urllib3.exceptions import LocationParseError
from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
Reported by Pylint.
Line: 8
Column: 1
from urllib3.exceptions import LocationParseError
from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
"""
Reported by Pylint.
Line: 9
Column: 1
from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
def is_connection_dropped(conn): # Platform-specific
"""
Returns True if the connection is dropped and should be closed.
Reported by Pylint.
Line: 40
Column: 13
# discovered in DNS if the system doesn't have IPv6 functionality.
def create_connection(
address,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None,
socket_options=None,
):
"""Connect to *address* and return the socket object.
Reported by Pylint.
Line: 74
Column: 30
)
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket.socket(af, socktype, proto)
# If provided, set socket level options before connecting.
Reported by Pylint.
Line: 82
Column: 31
# If provided, set socket level options before connecting.
_set_socket_options(sock, socket_options)
if timeout is not socket._GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
sock.connect(sa)
return sock
Reported by Pylint.
Line: 142
Column: 16
sock = socket.socket(socket.AF_INET6)
sock.bind((host, 0))
has_ipv6 = True
except Exception:
pass
if sock:
sock.close()
return has_ipv6
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
import socket
from urllib3.exceptions import LocationParseError
from ..contrib import _appengine_environ
from ..packages import six
from .wait import NoWayToWaitForSocketError, wait_for_read
Reported by Pylint.
Line: 38
Column: 1
# library test suite. Added to its signature is only `socket_options`.
# One additional modification is that we avoid binding to IPv6 servers
# discovered in DNS if the system doesn't have IPv6 functionality.
def create_connection(
address,
timeout=socket._GLOBAL_DEFAULT_TIMEOUT,
source_address=None,
socket_options=None,
):
Reported by Pylint.
Line: 74
Column: 41
)
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket.socket(af, socktype, proto)
# If provided, set socket level options before connecting.
Reported by Pylint.
pipenv/patched/notpip/_vendor/distlib/markers.py
13 issues
Line: 20
Column: 1
import platform
import re
from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker
__all__ = ['interpret']
def _is_literal(o):
Reported by Pylint.
Line: 21
Column: 1
import re
from .compat import python_implementation, urlparse, 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: 18
Column: 1
import os
import sys
import platform
import re
from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker
__all__ = ['interpret']
Reported by Pylint.
Line: 20
Column: 1
import platform
import re
from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker
__all__ = ['interpret']
def _is_literal(o):
Reported by Pylint.
Line: 20
Column: 1
import platform
import re
from .compat import python_implementation, urlparse, string_types
from .util import in_venv, parse_marker
__all__ = ['interpret']
def _is_literal(o):
Reported by Pylint.
Line: 125
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: 25
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: 30
Column: 1
return False
return o[0] in '\'"'
class Evaluator(object):
"""
This class is used to evaluate marker expessions.
"""
operations = {
Reported by Pylint.
Line: 30
Column: 1
return False
return o[0] in '\'"'
class Evaluator(object):
"""
This class is used to evaluate marker expessions.
"""
operations = {
Reported by Pylint.
Line: 63
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.
pipenv/patched/notpip/_vendor/chardet/mbcsgroupprober.py
13 issues
Line: 30
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
Reported by Pylint.
Line: 31
Column: 1
######################### END LICENSE BLOCK #########################
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
Reported by Pylint.
Line: 32
Column: 1
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
Reported by Pylint.
Line: 33
Column: 1
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
Reported by Pylint.
Line: 34
Column: 1
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
Reported by Pylint.
Line: 35
Column: 1
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
Reported by Pylint.
Line: 36
Column: 1
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
class MBCSGroupProber(CharSetGroupProber):
Reported by Pylint.
Line: 37
Column: 1
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
class MBCSGroupProber(CharSetGroupProber):
def __init__(self, lang_filter=None):
Reported by Pylint.
Line: 38
Column: 1
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
class MBCSGroupProber(CharSetGroupProber):
def __init__(self, lang_filter=None):
super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)
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.
pipenv/patched/notpip/_internal/req/req_set.py
13 issues
Line: 204
Column: 9
if project_name in self.requirements:
return self.requirements[project_name]
pass
def cleanup_files(self):
# type: () -> None
"""Clean up files, remove builds."""
logger.debug('Cleaning up...')
Reported by Pylint.
Line: 1
Column: 1
# The following comment should be removed at some point in the future.
# mypy: strict-optional=False
from __future__ import absolute_import
import logging
from collections import OrderedDict
from pipenv.patched.notpip._vendor.packaging.utils import canonicalize_name
Reported by Pylint.
Line: 25
Column: 1
logger = logging.getLogger(__name__)
class RequirementSet(object):
def __init__(self, check_supported_wheels=True, ignore_compatibility=True):
# type: (bool, bool) -> None
"""Create a RequirementSet.
"""
Reported by Pylint.
Line: 25
Column: 1
logger = logging.getLogger(__name__)
class RequirementSet(object):
def __init__(self, check_supported_wheels=True, ignore_compatibility=True):
# type: (bool, bool) -> None
"""Create a RequirementSet.
"""
Reported by Pylint.
Line: 40
Column: 1
self.reqs_to_cleanup = [] # type: List[InstallRequirement]
if ignore_compatibility:
self.check_supported_wheels = False
self.ignore_compatibility = (check_supported_wheels is False or ignore_compatibility is True)
def __str__(self):
# type: () -> str
requirements = sorted(
(req for req in self.requirements.values() if not req.comes_from),
Reported by Pylint.
Line: 64
Column: 5
reqs=', '.join(str(req.req) for req in requirements),
)
def add_unnamed_requirement(self, install_req):
# type: (InstallRequirement) -> None
assert not install_req.name
self.unnamed_requirements.append(install_req)
def add_named_requirement(self, install_req):
Reported by Pylint.
Line: 66
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
def add_unnamed_requirement(self, install_req):
# type: (InstallRequirement) -> None
assert not install_req.name
self.unnamed_requirements.append(install_req)
def add_named_requirement(self, install_req):
# type: (InstallRequirement) -> None
assert install_req.name
Reported by Bandit.
Line: 69
Column: 5
assert not install_req.name
self.unnamed_requirements.append(install_req)
def add_named_requirement(self, install_req):
# type: (InstallRequirement) -> None
assert install_req.name
project_name = canonicalize_name(install_req.name)
self.requirements[project_name] = install_req
Reported by Pylint.
Line: 71
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
def add_named_requirement(self, install_req):
# type: (InstallRequirement) -> None
assert install_req.name
project_name = canonicalize_name(install_req.name)
self.requirements[project_name] = install_req
def add_requirement(
Reported by Bandit.
Line: 119
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
)
# This next bit is really a sanity check.
assert install_req.is_direct == (parent_req_name is None), (
"a direct req shouldn't have a parent and also, "
"a non direct req should have a parent"
)
# Unnamed requirements are scanned again and the requirement won't be
Reported by Bandit.
pipenv/vendor/chardet/mbcsgroupprober.py
13 issues
Line: 30
Column: 1
# 02110-1301 USA
######################### END LICENSE BLOCK #########################
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
Reported by Pylint.
Line: 31
Column: 1
######################### END LICENSE BLOCK #########################
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
Reported by Pylint.
Line: 32
Column: 1
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
Reported by Pylint.
Line: 33
Column: 1
from .charsetgroupprober import CharSetGroupProber
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
Reported by Pylint.
Line: 34
Column: 1
from .utf8prober import UTF8Prober
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
Reported by Pylint.
Line: 35
Column: 1
from .sjisprober import SJISProber
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
Reported by Pylint.
Line: 36
Column: 1
from .eucjpprober import EUCJPProber
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
class MBCSGroupProber(CharSetGroupProber):
Reported by Pylint.
Line: 37
Column: 1
from .gb2312prober import GB2312Prober
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
class MBCSGroupProber(CharSetGroupProber):
def __init__(self, lang_filter=None):
Reported by Pylint.
Line: 38
Column: 1
from .euckrprober import EUCKRProber
from .cp949prober import CP949Prober
from .big5prober import Big5Prober
from .euctwprober import EUCTWProber
class MBCSGroupProber(CharSetGroupProber):
def __init__(self, lang_filter=None):
super(MBCSGroupProber, self).__init__(lang_filter=lang_filter)
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.
pipenv/vendor/shellingham/nt.py
13 issues
Line: 17
Column: 1
ULONG,
)
from shellingham._core import SHELL_NAMES
INVALID_HANDLE_VALUE = HANDLE(-1).value
ERROR_NO_MORE_FILES = 18
ERROR_INSUFFICIENT_BUFFER = 122
Reported by Pylint.
Line: 31
Column: 20
def _check_handle(error_val=0):
def check(ret, func, args):
if ret == error_val:
raise ctypes.WinError()
return ret
return check
Reported by Pylint.
Line: 31
Column: 26
def _check_handle(error_val=0):
def check(ret, func, args):
if ret == error_val:
raise ctypes.WinError()
return ret
return check
Reported by Pylint.
Line: 40
Column: 26
def _check_expected(expected):
def check(ret, func, args):
if ret:
return True
code = ctypes.GetLastError()
if code == expected:
return False
Reported by Pylint.
Line: 40
Column: 20
def _check_expected(expected):
def check(ret, func, args):
if ret:
return True
code = ctypes.GetLastError()
if code == expected:
return False
Reported by Pylint.
Line: 116
Column: 9
f = kernel32.CreateToolhelp32Snapshot
with _handle(f, TH32CS_SNAPPROCESS, 0) as snap:
entry = ProcessEntry32()
entry.dwSize = ctypes.sizeof(entry)
ret = kernel32.Process32First(snap, entry)
while ret:
yield entry
ret = kernel32.Process32Next(snap, entry)
Reported by Pylint.
Line: 1
Column: 1
import contextlib
import ctypes
import os
from ctypes.wintypes import (
BOOL,
CHAR,
DWORD,
HANDLE,
Reported by Pylint.
Line: 51
Column: 1
return check
class ProcessEntry32(ctypes.Structure):
_fields_ = (
("dwSize", DWORD),
("cntUsage", DWORD),
("th32ProcessID", DWORD),
("th32DefaultHeapID", ctypes.POINTER(ULONG)),
Reported by Pylint.
Line: 51
Column: 1
return check
class ProcessEntry32(ctypes.Structure):
_fields_ = (
("dwSize", DWORD),
("cntUsage", DWORD),
("th32ProcessID", DWORD),
("th32DefaultHeapID", ctypes.POINTER(ULONG)),
Reported by Pylint.
Line: 104
Column: 1
@contextlib.contextmanager
def _handle(f, *args, **kwargs):
handle = f(*args, **kwargs)
try:
yield handle
finally:
kernel32.CloseHandle(handle)
Reported by Pylint.
pipenv/vendor/chardet/langrussianmodel.py
13 issues
Line: 4
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
Reported by Pylint.
Line: 4382
Column: 1
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
WINDOWS_1251_RUSSIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.
Line: 4645
Column: 1
WINDOWS_1251_RUSSIAN_MODEL = SingleByteCharSetModel(charset_name='windows-1251',
language='Russian',
char_to_order_map=WINDOWS_1251_RUSSIAN_CHAR_TO_ORDER,
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
Reported by Pylint.
Line: 4649
Column: 1
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
IBM855_RUSSIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.
Line: 4916
Column: 1
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
KOI8_R_RUSSIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.
Line: 5183
Column: 1
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
MACCYRILLIC_RUSSIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.
Line: 5446
Column: 1
MACCYRILLIC_RUSSIAN_MODEL = SingleByteCharSetModel(charset_name='MacCyrillic',
language='Russian',
char_to_order_map=MACCYRILLIC_RUSSIAN_CHAR_TO_ORDER,
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
Reported by Pylint.
Line: 5450
Column: 1
language_model=RUSSIAN_LANG_MODEL,
typical_positive_ratio=0.976601,
keep_ascii_letters=False,
alphabet='ЁАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдежзийклмнопрстуфхцчшщъыьэюяё')
ISO_8859_5_RUSSIAN_CHAR_TO_ORDER = {
0: 255, # '\x00'
1: 255, # '\x01'
2: 255, # '\x02'
Reported by Pylint.