The following issues were found
pipenv/vendor/shellingham/__init__.py
5 issues
Line: 4
Column: 1
import importlib
import os
from ._core import ShellDetectionFailure
__version__ = "1.4.0"
Reported by Pylint.
Line: 16
Column: 9
impl = importlib.import_module(".{}".format(name), __name__)
except ImportError:
message = "Shell detection not implemented for {0!r}".format(name)
raise RuntimeError(message)
try:
get_shell = impl.get_shell
except AttributeError:
raise RuntimeError("get_shell not implemented for {0!r}".format(name))
shell = get_shell(pid, max_depth=max_depth)
Reported by Pylint.
Line: 20
Column: 9
try:
get_shell = impl.get_shell
except AttributeError:
raise RuntimeError("get_shell not implemented for {0!r}".format(name))
shell = get_shell(pid, max_depth=max_depth)
if shell:
return shell
raise ShellDetectionFailure()
Reported by Pylint.
Line: 1
Column: 1
import importlib
import os
from ._core import ShellDetectionFailure
__version__ = "1.4.0"
Reported by Pylint.
Line: 10
Column: 1
__version__ = "1.4.0"
def detect_shell(pid=None, max_depth=10):
name = os.name
try:
impl = importlib.import_module(".{}".format(name), __name__)
except ImportError:
message = "Shell detection not implemented for {0!r}".format(name)
Reported by Pylint.
pipenv/vendor/pythonfinder/models/__init__.py
5 issues
Line: 11
Column: 1
import six
from ..utils import KNOWN_EXTS, unnest
from .path import SystemPath
from .python import PythonVersion
from .windows import WindowsFinder
Reported by Pylint.
Line: 12
Column: 1
import six
from ..utils import KNOWN_EXTS, unnest
from .path import SystemPath
from .python import PythonVersion
from .windows import WindowsFinder
Reported by Pylint.
Line: 13
Column: 1
from ..utils import KNOWN_EXTS, unnest
from .path import SystemPath
from .python import PythonVersion
from .windows import WindowsFinder
Reported by Pylint.
Line: 14
Column: 1
from ..utils import KNOWN_EXTS, unnest
from .path import SystemPath
from .python import PythonVersion
from .windows import WindowsFinder
Reported by Pylint.
Line: 1
Column: 1
# -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import abc
import operator
from itertools import chain
import six
Reported by Pylint.
pipenv/vendor/ptyprocess/_fork_pty.py
5 issues
Line: 7
Column: 1
import errno
from pty import (STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO, CHILD)
from .util import PtyProcessError
def fork_pty():
'''This implements a substitute for the forkpty system call. This
should be more portable than the pty.fork() function. Specifically,
this should work on Solaris.
Reported by Pylint.
Line: 54
Column: 9
# if there was no controlling tty to begin with, such as when
# executed by a cron(1) job.
try:
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
os.close(fd)
except OSError as err:
if err.errno != errno.ENXIO:
raise
Reported by Pylint.
Line: 65
Column: 9
# Verify we are disconnected from controlling tty by attempting to open
# it again. We expect that OSError of ENXIO should always be raised.
try:
fd = os.open("/dev/tty", os.O_RDWR | os.O_NOCTTY)
os.close(fd)
raise PtyProcessError("OSError of errno.ENXIO should be raised.")
except OSError as err:
if err.errno != errno.ENXIO:
raise
Reported by Pylint.
Line: 73
Column: 5
raise
# Verify we can open child pty.
fd = os.open(child_name, os.O_RDWR)
os.close(fd)
# Verify we now have a controlling tty.
fd = os.open("/dev/tty", os.O_WRONLY)
os.close(fd)
Reported by Pylint.
Line: 77
Column: 5
os.close(fd)
# Verify we now have a controlling tty.
fd = os.open("/dev/tty", os.O_WRONLY)
os.close(fd)
Reported by Pylint.
pipenv/patched/notpip/_internal/distributions/base.py
5 issues
Line: 1
Column: 1
import abc
from pipenv.patched.notpip._vendor.six import add_metaclass
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
if MYPY_CHECK_RUNNING:
from typing import Optional
Reported by Pylint.
Line: 16
Column: 1
@add_metaclass(abc.ABCMeta)
class AbstractDistribution(object):
"""A base class for handling installable artifacts.
The requirements for anything installable are as follows:
- we must be able to determine the requirement name
Reported by Pylint.
Line: 34
Column: 9
def __init__(self, req):
# type: (InstallRequirement) -> None
super(AbstractDistribution, self).__init__()
self.req = req
@abc.abstractmethod
def get_pkg_resources_distribution(self):
# type: () -> Optional[Distribution]
Reported by Pylint.
Line: 38
Column: 5
self.req = req
@abc.abstractmethod
def get_pkg_resources_distribution(self):
# type: () -> Optional[Distribution]
raise NotImplementedError()
@abc.abstractmethod
def prepare_distribution_metadata(self, finder, build_isolation):
Reported by Pylint.
Line: 43
Column: 5
raise NotImplementedError()
@abc.abstractmethod
def prepare_distribution_metadata(self, finder, build_isolation):
# type: (PackageFinder, bool) -> None
raise NotImplementedError()
Reported by Pylint.
pipenv/patched/safety/__main__.py
5 issues
Line: 50
Column: 5
yaml_lib = "pipenv.patched.yaml{0}".format(sys.version_info[0])
locals()[yaml_lib] = __import__(yaml_lib)
sys.modules["yaml"] = sys.modules[yaml_lib]
from safety.cli import cli
cli(prog_name="safety")
Reported by Pylint.
Line: 14
Column: 1
VENDORED_DIR = os.path.join("PIPENV_DIR", "vendor")
def get_site_packages():
prefixes = {sys.prefix, sysconfig.get_config_var('prefix')}
try:
prefixes.add(sys.real_prefix)
except AttributeError:
pass
Reported by Pylint.
Line: 28
Column: 1
}
def insert_before_site_packages(*paths):
site_packages = get_site_packages()
index = None
for i, path in enumerate(sys.path):
if path in site_packages:
index = i
Reported by Pylint.
Line: 41
Column: 1
sys.path = sys.path[:index] + list(paths) + sys.path[index:]
def insert_pipenv_dirs():
insert_before_site_packages(os.path.dirname(PIPENV_DIR), PATCHED_DIR, VENDORED_DIR)
if __name__ == "__main__": # pragma: no cover
insert_pipenv_dirs()
Reported by Pylint.
Line: 47
Column: 5
if __name__ == "__main__": # pragma: no cover
insert_pipenv_dirs()
yaml_lib = "pipenv.patched.yaml{0}".format(sys.version_info[0])
locals()[yaml_lib] = __import__(yaml_lib)
sys.modules["yaml"] = sys.modules[yaml_lib]
from safety.cli import cli
cli(prog_name="safety")
Reported by Pylint.
pipenv/vendor/urllib3/util/response.py
5 issues
Line: 5
Column: 1
from email.errors import MultipartInvariantViolationDefect, StartBoundaryNotFoundDefect
from ..exceptions import HeaderParsingError
from ..packages.six.moves import http_client as httplib
def is_fp_closed(obj):
"""
Reported by Pylint.
Line: 6
Column: 1
from email.errors import MultipartInvariantViolationDefect, StartBoundaryNotFoundDefect
from ..exceptions import HeaderParsingError
from ..packages.six.moves import http_client as httplib
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
Reported by Pylint.
Line: 103
Column: 3
Response to check if the originating request
used 'HEAD' as a method.
"""
# FIXME: Can we do this somehow without accessing private httplib _method?
method = response._method
if isinstance(method, int): # Platform-specific: Appengine
return method == 3
return method.upper() == "HEAD"
Reported by Pylint.
Line: 104
Column: 14
used 'HEAD' as a method.
"""
# FIXME: Can we do this somehow without accessing private httplib _method?
method = response._method
if isinstance(method, int): # Platform-specific: Appengine
return method == 3
return method.upper() == "HEAD"
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
from email.errors import MultipartInvariantViolationDefect, StartBoundaryNotFoundDefect
from ..exceptions import HeaderParsingError
from ..packages.six.moves import http_client as httplib
def is_fp_closed(obj):
Reported by Pylint.
pipenv/patched/notpip/_vendor/urllib3/util/response.py
5 issues
Line: 2
Column: 1
from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
Reported by Pylint.
Line: 4
Column: 1
from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
Reported by Pylint.
Line: 82
Column: 3
:param conn:
:type conn: :class:`httplib.HTTPResponse`
"""
# FIXME: Can we do this somehow without accessing private httplib _method?
method = response._method
if isinstance(method, int): # Platform-specific: Appengine
return method == 3
return method.upper() == "HEAD"
Reported by Pylint.
Line: 83
Column: 14
:type conn: :class:`httplib.HTTPResponse`
"""
# FIXME: Can we do this somehow without accessing private httplib _method?
method = response._method
if isinstance(method, int): # Platform-specific: Appengine
return method == 3
return method.upper() == "HEAD"
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
from ..packages.six.moves import http_client as httplib
from ..exceptions import HeaderParsingError
def is_fp_closed(obj):
"""
Checks whether a given file-like object is closed.
Reported by Pylint.
pipenv/vendor/pip_shims/shims.py
5 issues
Line: 10
Column: 1
import sys
import types
from packaging.version import parse as parse_version
from .models import (
ShimmedPathCollection,
get_package_finder,
import_pip,
Reported by Pylint.
Line: 12
Column: 1
from packaging.version import parse as parse_version
from .models import (
ShimmedPathCollection,
get_package_finder,
import_pip,
lookup_current_pip_version,
)
Reported by Pylint.
Line: 24
Column: 5
CURRENT_PIP_VERSION = str(lookup_current_pip_version())
@classmethod
def parse_version(cls, version):
return parse_version(version)
def __dir__(self):
result = list(self._locations.keys()) + list(self.__dict__.keys())
result.extend(
Reported by Pylint.
Line: 59
Column: 21
self.parsed_pip_version = lookup_current_pip_version()
def __getattr__(self, *args, **kwargs):
locations = super(_shims, self).__getattribute__("_locations")
if args[0] in locations:
return locations[args[0]].shim()
return super(_shims, self).__getattribute__(*args, **kwargs)
Reported by Pylint.
Line: 62
Column: 16
locations = super(_shims, self).__getattribute__("_locations")
if args[0] in locations:
return locations[args[0]].shim()
return super(_shims, self).__getattribute__(*args, **kwargs)
old_module = sys.modules[__name__] if __name__ in sys.modules else None
module = sys.modules[__name__] = _shims()
module.__dict__.update(
Reported by Pylint.
pipenv/patched/notpip/_vendor/urllib3/fields.py
5 issues
Line: 6
Column: 1
import mimetypes
import re
from .packages import six
def guess_content_type(filename, default="application/octet-stream"):
"""
Guess the "Content-Type" of a file.
Reported by Pylint.
Line: 64
Column: 23
return value
_HTML5_REPLACEMENTS = {
u"\u0022": u"%22",
# Replace "\" with "\\".
u"\u005C": u"\u005C\u005C",
u"\u005C": u"\u005C\u005C",
}
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
import email.utils
import mimetypes
import re
from .packages import six
def guess_content_type(filename, default="application/octet-stream"):
Reported by Pylint.
Line: 125
Column: 1
format_header_param = format_header_param_html5
class RequestField(object):
"""
A data container for request body parameters.
:param name:
The name of this request field. Must be unicode.
Reported by Pylint.
Line: 142
Column: 5
default, this is :func:`format_header_param_html5`.
"""
def __init__(
self,
name,
data,
filename=None,
headers=None,
Reported by Pylint.
pipenv/vendor/importlib_resources/tests/update-zips.py
5 issues
Line: 53
Column: 1
yield res, rel
__name__ == '__main__' and main()
Reported by Pylint.
Line: 1
Column: 1
"""
Generate the zip test data files.
Run to build the tests/zipdataNN/ziptestdata.zip files from
files in tests/dataNN.
Replaces the file with the working copy, but does commit anything
to the source repo.
"""
Reported by Pylint.
Line: 33
Column: 1
tuple(map(generate, suffixes))
def generate(suffix):
root = pathlib.Path(__file__).parent.relative_to(os.getcwd())
zfpath = root / f'zipdata{suffix}/ziptestdata.zip'
with zipfile.ZipFile(zfpath, 'w') as zf:
for src, rel in walk(root / f'data{suffix}'):
dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix())
Reported by Pylint.
Line: 36
Column: 42
def generate(suffix):
root = pathlib.Path(__file__).parent.relative_to(os.getcwd())
zfpath = root / f'zipdata{suffix}/ziptestdata.zip'
with zipfile.ZipFile(zfpath, 'w') as zf:
for src, rel in walk(root / f'data{suffix}'):
dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix())
print(src, '->', dst)
zf.write(src, dst)
Reported by Pylint.
Line: 43
Column: 1
zf.write(src, dst)
def walk(datapath):
for dirpath, dirnames, filenames in os.walk(datapath):
with contextlib.suppress(KeyError):
dirnames.remove('__pycache__')
for filename in filenames:
res = pathlib.Path(dirpath) / filename
Reported by Pylint.