The following issues were found
pipenv/vendor/pyparsing.py
1056 issues
Line: 233
Column: 16
singleArgBuiltins = [sum, len, sorted, reversed, list, tuple, set, any, all, min, max]
else:
_MAX_INT = sys.maxint
range = xrange
def _ustr(obj):
"""Drop-in replacement for str(obj) that tries to be Unicode
friendly. It first tries str(obj). If that fails with
Reported by Pylint.
Line: 234
Column: 13
else:
_MAX_INT = sys.maxint
range = xrange
def _ustr(obj):
"""Drop-in replacement for str(obj) that tries to be Unicode
friendly. It first tries str(obj). If that fails with
a UnicodeEncodeError, then it tries unicode(obj). It then
Reported by Pylint.
Line: 260
Column: 5
# build list of single arg builtins, tolerant of Python version, that can be used as parse actions
singleArgBuiltins = []
import __builtin__
for fname in "sum len sorted reversed list tuple set any all min max".split():
try:
singleArgBuiltins.append(getattr(__builtin__, fname))
except AttributeError:
Reported by Pylint.
Line: 1841
Column: 25
with ParserElement.packrat_cache_lock:
cache = ParserElement.packrat_cache
value = cache.get(lookup)
if value is cache.not_in_cache:
ParserElement.packrat_cache_stats[MISS] += 1
try:
value = self._parseNoCache(instring, loc, doActions, callPreParse)
except ParseBaseException as pe:
# cache a copy of the exception, without the traceback
Reported by Pylint.
Line: 1847
Column: 21
value = self._parseNoCache(instring, loc, doActions, callPreParse)
except ParseBaseException as pe:
# cache a copy of the exception, without the traceback
cache.set(lookup, pe.__class__(*pe.args))
raise
else:
cache.set(lookup, (value[0], value[1].copy()))
return value
else:
Reported by Pylint.
Line: 1850
Column: 21
cache.set(lookup, pe.__class__(*pe.args))
raise
else:
cache.set(lookup, (value[0], value[1].copy()))
return value
else:
ParserElement.packrat_cache_stats[HIT] += 1
if isinstance(value, Exception):
raise value
Reported by Pylint.
Line: 5086
Column: 31
def _setResultsName(self, name, listAllMatches=False):
if __diag__.warn_name_set_on_empty_Forward:
if self.expr is None:
warnings.warn("{0}: setting results name {0!r} on {1} expression "
"that has no contained expression".format("warn_name_set_on_empty_Forward",
name,
type(self).__name__),
stacklevel=3)
Reported by Pylint.
Line: 6743
Column: 5
return [unichr(c) for c in sorted(set(ret))]
@_lazyclassproperty
def printables(cls):
"all non-whitespace characters in this range"
return u''.join(filterfalse(unicode.isspace, cls._get_chars_for_ranges()))
@_lazyclassproperty
def alphas(cls):
Reported by Pylint.
Line: 6748
Column: 5
return u''.join(filterfalse(unicode.isspace, cls._get_chars_for_ranges()))
@_lazyclassproperty
def alphas(cls):
"all alphabetic characters in this range"
return u''.join(filter(unicode.isalpha, cls._get_chars_for_ranges()))
@_lazyclassproperty
def nums(cls):
Reported by Pylint.
Line: 6753
Column: 5
return u''.join(filter(unicode.isalpha, cls._get_chars_for_ranges()))
@_lazyclassproperty
def nums(cls):
"all numeric digit characters in this range"
return u''.join(filter(unicode.isdigit, cls._get_chars_for_ranges()))
@_lazyclassproperty
def alphanums(cls):
Reported by Pylint.
pipenv/patched/notpip/_vendor/pyparsing.py
1049 issues
Line: 233
Column: 16
singleArgBuiltins = [sum, len, sorted, reversed, list, tuple, set, any, all, min, max]
else:
_MAX_INT = sys.maxint
range = xrange
def _ustr(obj):
"""Drop-in replacement for str(obj) that tries to be Unicode
friendly. It first tries str(obj). If that fails with
Reported by Pylint.
Line: 234
Column: 13
else:
_MAX_INT = sys.maxint
range = xrange
def _ustr(obj):
"""Drop-in replacement for str(obj) that tries to be Unicode
friendly. It first tries str(obj). If that fails with
a UnicodeEncodeError, then it tries unicode(obj). It then
Reported by Pylint.
Line: 260
Column: 5
# build list of single arg builtins, tolerant of Python version, that can be used as parse actions
singleArgBuiltins = []
import __builtin__
for fname in "sum len sorted reversed list tuple set any all min max".split():
try:
singleArgBuiltins.append(getattr(__builtin__, fname))
except AttributeError:
Reported by Pylint.
Line: 1835
Column: 25
with ParserElement.packrat_cache_lock:
cache = ParserElement.packrat_cache
value = cache.get(lookup)
if value is cache.not_in_cache:
ParserElement.packrat_cache_stats[MISS] += 1
try:
value = self._parseNoCache(instring, loc, doActions, callPreParse)
except ParseBaseException as pe:
# cache a copy of the exception, without the traceback
Reported by Pylint.
Line: 1841
Column: 21
value = self._parseNoCache(instring, loc, doActions, callPreParse)
except ParseBaseException as pe:
# cache a copy of the exception, without the traceback
cache.set(lookup, pe.__class__(*pe.args))
raise
else:
cache.set(lookup, (value[0], value[1].copy()))
return value
else:
Reported by Pylint.
Line: 1844
Column: 21
cache.set(lookup, pe.__class__(*pe.args))
raise
else:
cache.set(lookup, (value[0], value[1].copy()))
return value
else:
ParserElement.packrat_cache_stats[HIT] += 1
if isinstance(value, Exception):
raise value
Reported by Pylint.
Line: 5069
Column: 31
def _setResultsName(self, name, listAllMatches=False):
if __diag__.warn_name_set_on_empty_Forward:
if self.expr is None:
warnings.warn("{0}: setting results name {0!r} on {1} expression "
"that has no contained expression".format("warn_name_set_on_empty_Forward",
name,
type(self).__name__),
stacklevel=3)
Reported by Pylint.
Line: 6726
Column: 5
return [unichr(c) for c in sorted(set(ret))]
@_lazyclassproperty
def printables(cls):
"all non-whitespace characters in this range"
return u''.join(filterfalse(unicode.isspace, cls._get_chars_for_ranges()))
@_lazyclassproperty
def alphas(cls):
Reported by Pylint.
Line: 6731
Column: 5
return u''.join(filterfalse(unicode.isspace, cls._get_chars_for_ranges()))
@_lazyclassproperty
def alphas(cls):
"all alphabetic characters in this range"
return u''.join(filter(unicode.isalpha, cls._get_chars_for_ranges()))
@_lazyclassproperty
def nums(cls):
Reported by Pylint.
Line: 6736
Column: 5
return u''.join(filter(unicode.isalpha, cls._get_chars_for_ranges()))
@_lazyclassproperty
def nums(cls):
"all numeric digit characters in this range"
return u''.join(filter(unicode.isdigit, cls._get_chars_for_ranges()))
@_lazyclassproperty
def alphanums(cls):
Reported by Pylint.
pipenv/patched/notpip/_vendor/html5lib/html5parser.py
662 issues
Line: 7
Column: 1
import types
from collections import OrderedDict
from . import _inputstream
from . import _tokenizer
from . import treebuilders
from .treebuilders.base import Marker
Reported by Pylint.
Line: 8
Column: 1
from collections import OrderedDict
from . import _inputstream
from . import _tokenizer
from . import treebuilders
from .treebuilders.base import Marker
from . import _utils
Reported by Pylint.
Line: 10
Column: 1
from . import _inputstream
from . import _tokenizer
from . import treebuilders
from .treebuilders.base import Marker
from . import _utils
from .constants import (
spaceCharacters, asciiUpper2Lower,
Reported by Pylint.
Line: 11
Column: 1
from . import _tokenizer
from . import treebuilders
from .treebuilders.base import Marker
from . import _utils
from .constants import (
spaceCharacters, asciiUpper2Lower,
specialElements, headingElements, cdataElements, rcdataElements,
Reported by Pylint.
Line: 13
Column: 1
from . import treebuilders
from .treebuilders.base import Marker
from . import _utils
from .constants import (
spaceCharacters, asciiUpper2Lower,
specialElements, headingElements, cdataElements, rcdataElements,
tokenTypes, tagTokenTypes,
namespaces,
Reported by Pylint.
Line: 14
Column: 1
from .treebuilders.base import Marker
from . import _utils
from .constants import (
spaceCharacters, asciiUpper2Lower,
specialElements, headingElements, cdataElements, rcdataElements,
tokenTypes, tagTokenTypes,
namespaces,
htmlIntegrationPointElements, mathmlTextIntegrationPointElements,
Reported by Pylint.
Line: 164
Column: 1
self.phase.insertHtmlElement()
self.resetInsertionMode()
else:
self.innerHTML = False # pylint:disable=redefined-variable-type
self.phase = self.phases["initial"]
self.lastPhase = None
self.beforeRCDataPhase = None
Reported by Pylint.
Line: 350
Column: 9
def reparseTokenNormal(self, token):
# pylint:disable=unused-argument
self.parser.phase()
def resetInsertionMode(self):
# The name of this method is mostly historical. (It's also used in the
# specification.)
last = False
Reported by Pylint.
Line: 472
Column: 20
self.tree.insertText(token["data"])
def processStartTag(self, token):
return self.startTagHandler[token["name"]](token)
def startTagHtml(self, token):
if not self.parser.firstStartTag and token["name"] == "html":
self.parser.parseError("non-html-root")
# XXX Need a check here to see if the first start tag token emitted is
Reported by Pylint.
Line: 485
Column: 20
self.parser.firstStartTag = False
def processEndTag(self, token):
return self.endTagHandler[token["name"]](token)
class InitialPhase(Phase):
def processSpaceCharacters(self, token):
pass
Reported by Pylint.
pipenv/patched/yaml3/scanner.py
441 issues
Line: 29
Column: 1
__all__ = ['Scanner', 'ScannerError']
from .error import MarkedYAMLError
from .tokens import *
class ScannerError(MarkedYAMLError):
pass
Reported by Pylint.
Line: 30
Column: 1
__all__ = ['Scanner', 'ScannerError']
from .error import MarkedYAMLError
from .tokens import *
class ScannerError(MarkedYAMLError):
pass
class SimpleKey:
Reported by Pylint.
Line: 166
Column: 28
# Compare the current indentation and column. It may add some tokens
# and decrease the current indentation level.
self.unwind_indent(self.column)
# Peek the next character.
ch = self.peek()
# Is it the end of stream?
Reported by Pylint.
Line: 169
Column: 14
self.unwind_indent(self.column)
# Peek the next character.
ch = self.peek()
# Is it the end of stream?
if ch == '\0':
return self.fetch_stream_end()
Reported by Pylint.
Line: 260
Column: 17
# No? It's an error. Let's produce a nice error message.
raise ScannerError("while scanning for the next token", None,
"found character %r that cannot start any token" % ch,
self.get_mark())
# Simple keys treatment.
def next_possible_simple_key(self):
# Return the number of the nearest possible simple key. Actually we
Reported by Pylint.
Line: 288
Column: 28
# height (may cause problems if indentation is broken though).
for level in list(self.possible_simple_keys):
key = self.possible_simple_keys[level]
if key.line != self.line \
or self.index-key.index > 1024:
if key.required:
raise ScannerError("while scanning a simple key", key.mark,
"could not find expected ':'", self.get_mark())
del self.possible_simple_keys[level]
Reported by Pylint.
Line: 289
Column: 24
for level in list(self.possible_simple_keys):
key = self.possible_simple_keys[level]
if key.line != self.line \
or self.index-key.index > 1024:
if key.required:
raise ScannerError("while scanning a simple key", key.mark,
"could not find expected ':'", self.get_mark())
del self.possible_simple_keys[level]
Reported by Pylint.
Line: 292
Column: 60
or self.index-key.index > 1024:
if key.required:
raise ScannerError("while scanning a simple key", key.mark,
"could not find expected ':'", self.get_mark())
del self.possible_simple_keys[level]
def save_possible_simple_key(self):
# The next token may start a simple key. We check if it's possible
# and save its position. This function is called for
Reported by Pylint.
Line: 301
Column: 59
# ALIAS, ANCHOR, TAG, SCALAR(flow), '[', and '{'.
# Check if a simple key is required at the current position.
required = not self.flow_level and self.indent == self.column
# The next token might be a simple key. Let's save it's number and
# position.
if self.allow_simple_key:
self.remove_possible_simple_key()
Reported by Pylint.
Line: 309
Column: 21
self.remove_possible_simple_key()
token_number = self.tokens_taken+len(self.tokens)
key = SimpleKey(token_number, required,
self.index, self.line, self.column, self.get_mark())
self.possible_simple_keys[self.flow_level] = key
def remove_possible_simple_key(self):
# Remove the saved possible key position at the current flow level.
if self.flow_level in self.possible_simple_keys:
Reported by Pylint.
tests/integration/test_lock.py
383 issues
Line: 5
Column: 1
import os
import sys
import pytest
from flaky import flaky
from vistir.compat import Path
from vistir.misc import to_text
from pipenv.utils import temp_environ
Reported by Pylint.
Line: 7
Column: 1
import pytest
from flaky import flaky
from vistir.compat import Path
from vistir.misc import to_text
from pipenv.utils import temp_environ
Reported by Pylint.
Line: 8
Column: 1
import pytest
from flaky import flaky
from vistir.compat import Path
from vistir.misc import to_text
from pipenv.utils import temp_environ
@pytest.mark.lock
Reported by Pylint.
Line: 9
Column: 1
from flaky import flaky
from vistir.compat import Path
from vistir.misc import to_text
from pipenv.utils import temp_environ
@pytest.mark.lock
@pytest.mark.requirements
Reported by Pylint.
Line: 102
Column: 9
@pytest.mark.keep_outdated
def test_keep_outdated_doesnt_remove_lockfile_entries(PipenvInstance):
with PipenvInstance(chdir=True) as p:
p._pipfile.add("requests", "==2.18.4")
p._pipfile.add("colorama", {"version": "*", "markers": "os_name=='FakeOS'"})
c = p.pipenv("install")
assert c.returncode == 0
assert "doesn't match your environment, its dependencies won't be resolved." in c.stderr
p._pipfile.add("six", "*")
Reported by Pylint.
Line: 103
Column: 9
def test_keep_outdated_doesnt_remove_lockfile_entries(PipenvInstance):
with PipenvInstance(chdir=True) as p:
p._pipfile.add("requests", "==2.18.4")
p._pipfile.add("colorama", {"version": "*", "markers": "os_name=='FakeOS'"})
c = p.pipenv("install")
assert c.returncode == 0
assert "doesn't match your environment, its dependencies won't be resolved." in c.stderr
p._pipfile.add("six", "*")
p.pipenv("lock --keep-outdated")
Reported by Pylint.
Line: 107
Column: 9
c = p.pipenv("install")
assert c.returncode == 0
assert "doesn't match your environment, its dependencies won't be resolved." in c.stderr
p._pipfile.add("six", "*")
p.pipenv("lock --keep-outdated")
assert "colorama" in p.lockfile["default"]
assert p.lockfile["default"]["colorama"]["markers"] == "os_name == 'FakeOS'"
Reported by Pylint.
Line: 116
Column: 9
@pytest.mark.lock
def test_resolve_skip_unmatched_requirements(PipenvInstance):
with PipenvInstance(chdir=True) as p:
p._pipfile.add("missing-package", {"markers": "os_name=='FakeOS'"})
c = p.pipenv("lock")
assert c.returncode == 0
assert (
"Could not find a version of missing-package; "
"os_name == 'FakeOS' that matches your environment"
Reported by Pylint.
Line: 129
Column: 9
@pytest.mark.keep_outdated
def test_keep_outdated_doesnt_upgrade_pipfile_pins(PipenvInstance):
with PipenvInstance(chdir=True) as p:
p._pipfile.add("urllib3", "==1.21.1")
c = p.pipenv("install")
assert c.returncode == 0
p._pipfile.add("requests", "==2.18.4")
c = p.pipenv("lock --keep-outdated")
assert c.returncode == 0
Reported by Pylint.
Line: 132
Column: 9
p._pipfile.add("urllib3", "==1.21.1")
c = p.pipenv("install")
assert c.returncode == 0
p._pipfile.add("requests", "==2.18.4")
c = p.pipenv("lock --keep-outdated")
assert c.returncode == 0
assert "requests" in p.lockfile["default"]
assert "urllib3" in p.lockfile["default"]
assert p.lockfile["default"]["requests"]["version"] == "==2.18.4"
Reported by Pylint.
pipenv/utils.py
315 issues
Line: 19
Column: 1
from distutils.spawn import find_executable
from urllib.parse import urlparse
import crayons
import parse
import toml
import tomlkit
from click import echo as click_echo
Reported by Pylint.
Line: 20
Column: 1
from urllib.parse import urlparse
import crayons
import parse
import toml
import tomlkit
from click import echo as click_echo
Reported by Pylint.
Line: 22
Column: 1
import crayons
import parse
import toml
import tomlkit
from click import echo as click_echo
from pipenv import environments
from pipenv._compat import DEFAULT_ENCODING
Reported by Pylint.
Line: 142
Column: 5
:raises: exceptions.PipenvCmdError
"""
from ._compat import decode_for_output
from .cmdparse import Script
catch_exceptions = kwargs.pop("catch_exceptions", True)
if isinstance(cmd, ((str,), list, tuple)):
cmd = Script.parse(cmd)
if not isinstance(cmd, Script):
Reported by Pylint.
Line: 143
Column: 5
"""
from ._compat import decode_for_output
from .cmdparse import Script
catch_exceptions = kwargs.pop("catch_exceptions", True)
if isinstance(cmd, ((str,), list, tuple)):
cmd = Script.parse(cmd)
if not isinstance(cmd, Script):
raise TypeError("Command input must be a string, list or tuple")
Reported by Pylint.
Line: 199
Column: 5
def python_version(path_to_python):
from .vendor.pythonfinder.utils import get_python_version
if not path_to_python:
return None
try:
version = get_python_version(path_to_python)
Reported by Pylint.
Line: 286
Column: 5
def get_project_index(project, index=None, trusted_hosts=None):
# type: (Optional[Union[str, TSource]], Optional[List[str]], Optional[Project]) -> TSource
from .project import SourceNotFound
if trusted_hosts is None:
trusted_hosts = []
if isinstance(index, Mapping):
return project.find_source(index.get("url"))
try:
Reported by Pylint.
Line: 365
Column: 25
# type: () -> Optional[str]
import pkg_resources
site_dir = next(
iter(d for d in pkg_resources.working_set if d.key.lower() == "pipenv"), None
)
if site_dir is not None:
return site_dir.location
return None
Reported by Pylint.
Line: 415
Column: 9
@staticmethod
@lru_cache()
def _get_pip_command():
from .vendor.pip_shims.shims import InstallCommand
return InstallCommand()
@classmethod
def get_metadata(
cls,
Reported by Pylint.
Line: 438
Column: 13
if markers_lookup is None:
markers_lookup = {}
if not req_dir:
from .vendor.vistir.path import create_tracked_tempdir
req_dir = create_tracked_tempdir(prefix="pipenv-", suffix="-reqdir")
transient_resolver = cls(
[], req_dir, project, sources, index_lookup=index_lookup,
markers_lookup=markers_lookup, clear=clear, pre=pre
)
Reported by Pylint.
pipenv/vendor/requirementslib/models/requirements.py
314 issues
Line: 13
Column: 1
from distutils.sysconfig import get_python_lib
import attr
import pip_shims
import six
from cached_property import cached_property
from packaging.markers import Marker
from packaging.requirements import Requirement as PackagingRequirement
from packaging.specifiers import (
Reported by Pylint.
Line: 15
Column: 1
import attr
import pip_shims
import six
from cached_property import cached_property
from packaging.markers import Marker
from packaging.requirements import Requirement as PackagingRequirement
from packaging.specifiers import (
InvalidSpecifier,
LegacySpecifier,
Reported by Pylint.
Line: 16
Column: 1
import pip_shims
import six
from cached_property import cached_property
from packaging.markers import Marker
from packaging.requirements import Requirement as PackagingRequirement
from packaging.specifiers import (
InvalidSpecifier,
LegacySpecifier,
Specifier,
Reported by Pylint.
Line: 17
Column: 1
import six
from cached_property import cached_property
from packaging.markers import Marker
from packaging.requirements import Requirement as PackagingRequirement
from packaging.specifiers import (
InvalidSpecifier,
LegacySpecifier,
Specifier,
SpecifierSet,
Reported by Pylint.
Line: 18
Column: 1
from cached_property import cached_property
from packaging.markers import Marker
from packaging.requirements import Requirement as PackagingRequirement
from packaging.specifiers import (
InvalidSpecifier,
LegacySpecifier,
Specifier,
SpecifierSet,
)
Reported by Pylint.
Line: 24
Column: 1
Specifier,
SpecifierSet,
)
from packaging.utils import canonicalize_name
from six.moves.urllib import parse as urllib_parse
from six.moves.urllib.parse import unquote
from vistir.compat import FileNotFoundError, Path, lru_cache
from vistir.contextmanagers import temp_path
from vistir.misc import dedup
Reported by Pylint.
Line: 27
Column: 1
from packaging.utils import canonicalize_name
from six.moves.urllib import parse as urllib_parse
from six.moves.urllib.parse import unquote
from vistir.compat import FileNotFoundError, Path, lru_cache
from vistir.contextmanagers import temp_path
from vistir.misc import dedup
from vistir.path import (
create_tracked_tempdir,
get_converted_relative_path,
Reported by Pylint.
Line: 28
Column: 1
from six.moves.urllib import parse as urllib_parse
from six.moves.urllib.parse import unquote
from vistir.compat import FileNotFoundError, Path, lru_cache
from vistir.contextmanagers import temp_path
from vistir.misc import dedup
from vistir.path import (
create_tracked_tempdir,
get_converted_relative_path,
is_file_url,
Reported by Pylint.
Line: 29
Column: 1
from six.moves.urllib.parse import unquote
from vistir.compat import FileNotFoundError, Path, lru_cache
from vistir.contextmanagers import temp_path
from vistir.misc import dedup
from vistir.path import (
create_tracked_tempdir,
get_converted_relative_path,
is_file_url,
is_valid_url,
Reported by Pylint.
Line: 30
Column: 1
from vistir.compat import FileNotFoundError, Path, lru_cache
from vistir.contextmanagers import temp_path
from vistir.misc import dedup
from vistir.path import (
create_tracked_tempdir,
get_converted_relative_path,
is_file_url,
is_valid_url,
mkdir_p,
Reported by Pylint.
pipenv/vendor/distlib/util.py
300 issues
Line: 33
Column: 1
import dummy_threading as threading
import time
from . import DistlibException
from .compat import (string_types, text_type, shutil, raw_input, StringIO,
cache_from_source, urlopen, urljoin, httplib, xmlrpclib,
splittype, HTTPHandler, BaseConfigurator, valid_ident,
Container, configparser, URLError, ZipFile, fsdecode,
unquote, urlparse)
Reported by Pylint.
Line: 34
Column: 1
import time
from . import DistlibException
from .compat import (string_types, text_type, shutil, raw_input, StringIO,
cache_from_source, urlopen, urljoin, httplib, xmlrpclib,
splittype, HTTPHandler, BaseConfigurator, valid_ident,
Container, configparser, URLError, ZipFile, fsdecode,
unquote, urlparse)
Reported by Pylint.
Line: 560
Column: 57
self.write_binary_file(path, data.encode(encoding))
def set_mode(self, bits, mask, files):
if os.name == 'posix' or (os.name == 'java' and os._name == 'posix'):
# Set the executable bits (owner, group, and world) on
# all the files specified.
for f in files:
if self.dry_run:
logger.info("changing mode of %s", f)
Reported by Pylint.
Line: 1412
Column: 5
yield fn
if ssl:
from .compat import (HTTPSHandler as BaseHTTPSHandler, match_hostname,
CertificateError)
#
# HTTPSConnection which verifies certificates/matches domains
Reported by Pylint.
Line: 1541
Column: 20
if _ver_info == (2, 6):
result = HTTP(h, timeout=self.timeout)
else:
if not self._connection or host != self._connection[0]:
self._extra_headers = eh
self._connection = host, httplib.HTTPConnection(h)
result = self._connection[1]
return result
Reported by Pylint.
Line: 1541
Column: 48
if _ver_info == (2, 6):
result = HTTP(h, timeout=self.timeout)
else:
if not self._connection or host != self._connection[0]:
self._extra_headers = eh
self._connection = host, httplib.HTTPConnection(h)
result = self._connection[1]
return result
Reported by Pylint.
Line: 1561
Column: 24
if _ver_info == (2, 6):
result = HTTPS(host, None, **kwargs)
else:
if not self._connection or host != self._connection[0]:
self._extra_headers = eh
self._connection = host, httplib.HTTPSConnection(h, None,
**kwargs)
result = self._connection[1]
return result
Reported by Pylint.
Line: 1561
Column: 52
if _ver_info == (2, 6):
result = HTTPS(host, None, **kwargs)
else:
if not self._connection or host != self._connection[0]:
self._extra_headers = eh
self._connection = host, httplib.HTTPSConnection(h, None,
**kwargs)
result = self._connection[1]
return result
Reported by Pylint.
Line: 1613
Column: 9
return self
def __exit__(self, *exc_info):
self.stream.close()
class CSVReader(CSVBase):
def __init__(self, **kwargs):
if 'stream' in kwargs:
Reported by Pylint.
Line: 1935
Column: 9
machine += '.%s' % bitness[sys.maxsize]
# fall through to standard osname-release-machine representation
elif osname[:3] == 'aix':
from _aix_support import aix_platform
return aix_platform()
elif osname[:6] == 'cygwin':
osname = 'cygwin'
rel_re = re.compile (r'[\d.]+', re.ASCII)
m = rel_re.match(release)
Reported by Pylint.
pipenv/core.py
284 issues
Line: 2395
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b602_subprocess_popen_with_shell_equals_true.html
# Command not found, maybe this is a shell built-in?
if not command:
return subprocess.Popen(script.cmdify(), shell=True, **options)
# Try to use CreateProcess directly if possible. Specifically catch
# Windows error 193 "Command is not a valid Win32 application" to handle
# a "command" that is non-executable. See pypa/pipenv#2727.
try:
Reported by Bandit.
Line: 2407
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b602_subprocess_popen_with_shell_equals_true.html
raise
# Try shell mode to use Windows's file association for file launch.
return subprocess.Popen(script.cmdify(), shell=True, **options)
def do_run_nt(project, script, path):
p = _launch_windows_subprocess(script, path)
p.communicate()
Reported by Bandit.
Line: 10
Column: 1
import warnings
import click
import dotenv
import pipfile
import vistir
from click_completion import init as init_completion
Reported by Pylint.
Line: 11
Column: 1
import click
import dotenv
import pipfile
import vistir
from click_completion import init as init_completion
from pipenv import environments, exceptions, pep508checker, progress
Reported by Pylint.
Line: 12
Column: 1
import click
import dotenv
import pipfile
import vistir
from click_completion import init as init_completion
from pipenv import environments, exceptions, pep508checker, progress
from pipenv._compat import decode_for_output, fix_utf8
Reported by Pylint.
Line: 14
Column: 1
import pipfile
import vistir
from click_completion import init as init_completion
from pipenv import environments, exceptions, pep508checker, progress
from pipenv._compat import decode_for_output, fix_utf8
from pipenv.patched import crayons
from pipenv.utils import (
Reported by Pylint.
Line: 147
Column: 5
def import_requirements(project, r=None, dev=False):
from .patched.notpip._vendor import requests as pip_requests
from .vendor.pip_shims.shims import parse_requirements
# Parse requirements.txt file with Pip's parser.
# Pip requires a `PipSession` which is a subclass of requests.Session.
# Since we're not making any network calls, it's initialized to nothing.
Reported by Pylint.
Line: 148
Column: 5
def import_requirements(project, r=None, dev=False):
from .patched.notpip._vendor import requests as pip_requests
from .vendor.pip_shims.shims import parse_requirements
# Parse requirements.txt file with Pip's parser.
# Pip requires a `PipSession` which is a subclass of requests.Session.
# Since we're not making any network calls, it's initialized to nothing.
if r:
Reported by Pylint.
Line: 204
Column: 5
def import_from_code(path="."):
from pipreqs import pipreqs
rs = []
try:
for r in pipreqs.get_all_imports(
path, encoding="utf-8", extra_ignore_dirs=[".venv"]
Reported by Pylint.
Line: 295
Column: 5
* Nothing fits, return None.
"""
from .vendor.pythonfinder import Finder
finder = Finder(system=False, global_search=True)
if not line:
return next(iter(finder.find_all_python_versions()), None)
# Use the windows finder executable
if (line.startswith("py ") or line.startswith("py.exe ")) and os.name == "nt":
Reported by Pylint.
pipenv/vendor/requirementslib/models/setup_info.py
278 issues
Line: 17
Column: 1
import attr
import chardet
import packaging.specifiers
import packaging.utils
import packaging.version
import pep517.envbuild
import pep517.wrappers
import six
Reported by Pylint.
Line: 18
Column: 1
import attr
import chardet
import packaging.specifiers
import packaging.utils
import packaging.version
import pep517.envbuild
import pep517.wrappers
import six
from appdirs import user_cache_dir
Reported by Pylint.
Line: 19
Column: 1
import chardet
import packaging.specifiers
import packaging.utils
import packaging.version
import pep517.envbuild
import pep517.wrappers
import six
from appdirs import user_cache_dir
from distlib.wheel import Wheel
Reported by Pylint.
Line: 20
Column: 1
import packaging.specifiers
import packaging.utils
import packaging.version
import pep517.envbuild
import pep517.wrappers
import six
from appdirs import user_cache_dir
from distlib.wheel import Wheel
from packaging.markers import Marker
Reported by Pylint.
Line: 21
Column: 1
import packaging.utils
import packaging.version
import pep517.envbuild
import pep517.wrappers
import six
from appdirs import user_cache_dir
from distlib.wheel import Wheel
from packaging.markers import Marker
from pip_shims.utils import call_function_with_correct_args
Reported by Pylint.
Line: 23
Column: 1
import pep517.envbuild
import pep517.wrappers
import six
from appdirs import user_cache_dir
from distlib.wheel import Wheel
from packaging.markers import Marker
from pip_shims.utils import call_function_with_correct_args
from six.moves import configparser
from six.moves.urllib.parse import urlparse, urlunparse
Reported by Pylint.
Line: 24
Column: 1
import pep517.wrappers
import six
from appdirs import user_cache_dir
from distlib.wheel import Wheel
from packaging.markers import Marker
from pip_shims.utils import call_function_with_correct_args
from six.moves import configparser
from six.moves.urllib.parse import urlparse, urlunparse
from vistir.compat import FileNotFoundError, Iterable, Mapping, Path, finalize, lru_cache
Reported by Pylint.
Line: 25
Column: 1
import six
from appdirs import user_cache_dir
from distlib.wheel import Wheel
from packaging.markers import Marker
from pip_shims.utils import call_function_with_correct_args
from six.moves import configparser
from six.moves.urllib.parse import urlparse, urlunparse
from vistir.compat import FileNotFoundError, Iterable, Mapping, Path, finalize, lru_cache
from vistir.contextmanagers import cd, temp_path
Reported by Pylint.
Line: 26
Column: 1
from appdirs import user_cache_dir
from distlib.wheel import Wheel
from packaging.markers import Marker
from pip_shims.utils import call_function_with_correct_args
from six.moves import configparser
from six.moves.urllib.parse import urlparse, urlunparse
from vistir.compat import FileNotFoundError, Iterable, Mapping, Path, finalize, lru_cache
from vistir.contextmanagers import cd, temp_path
from vistir.misc import run
Reported by Pylint.
Line: 29
Column: 1
from pip_shims.utils import call_function_with_correct_args
from six.moves import configparser
from six.moves.urllib.parse import urlparse, urlunparse
from vistir.compat import FileNotFoundError, Iterable, Mapping, Path, finalize, lru_cache
from vistir.contextmanagers import cd, temp_path
from vistir.misc import run
from vistir.path import create_tracked_tempdir, ensure_mkdir_p, mkdir_p, rmtree
from ..environment import MYPY_RUNNING
Reported by Pylint.