The following issues were found
pipenv/vendor/requests/_internal_utils.py
3 issues
Line: 11
Column: 1
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
Reported by Pylint.
Line: 11
Column: 1
which depend on extremely few external helpers (such as compat)
"""
from .compat import is_py2, builtin_str, str
def to_native_string(string, encoding='ascii'):
"""Given a string object, regardless of type, returns a representation of
that string in the native string type, encoding and decoding where
Reported by Pylint.
Line: 37
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html
and not Python 2 `str`.
:rtype: bool
"""
assert isinstance(u_string, str)
try:
u_string.encode('ascii')
return True
except UnicodeEncodeError:
return False
Reported by Bandit.
pipenv/patched/piptools/repositories/base.py
3 issues
Line: 1
Column: 1
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from abc import ABCMeta, abstractmethod
from contextlib import contextmanager
from six import add_metaclass
Reported by Pylint.
Line: 11
Column: 1
@add_metaclass(ABCMeta)
class BaseRepository(object):
def clear_caches(self):
"""Should clear any caches used by the implementation."""
def freshen_build_caches(self):
"""Should start with fresh build/source caches."""
Reported by Pylint.
Line: 11
Column: 1
@add_metaclass(ABCMeta)
class BaseRepository(object):
def clear_caches(self):
"""Should clear any caches used by the implementation."""
def freshen_build_caches(self):
"""Should start with fresh build/source caches."""
Reported by Pylint.
pipenv/patched/piptools/locations.py
3 issues
Line: 4
Column: 1
import os
from shutil import rmtree
from ._compat import user_cache_dir
from .click import secho
# The user_cache_dir helper comes straight from pipenv.patched.notpip itself
try:
Reported by Pylint.
Line: 6
Column: 1
from ._compat import user_cache_dir
from .click import secho
# The user_cache_dir helper comes straight from pipenv.patched.notpip itself
try:
from pipenv.environments import PIPENV_CACHE_DIR as CACHE_DIR
except ImportError:
Reported by Pylint.
Line: 1
Column: 1
import os
from shutil import rmtree
from ._compat import user_cache_dir
from .click import secho
# The user_cache_dir helper comes straight from pipenv.patched.notpip itself
try:
Reported by Pylint.
pipenv/patched/piptools/repositories/__init__.py
3 issues
Line: 2
Column: 1
# flake8: noqa
from .local import LocalRequirementsRepository
from .pypi import PyPIRepository
Reported by Pylint.
Line: 3
Column: 1
# flake8: noqa
from .local import LocalRequirementsRepository
from .pypi import PyPIRepository
Reported by Pylint.
Line: 1
Column: 1
# flake8: noqa
from .local import LocalRequirementsRepository
from .pypi import PyPIRepository
Reported by Pylint.
pipenv/patched/piptools/_compat/contextlib.py
3 issues
Line: 1
Column: 1
# Ported from python 3.7 contextlib.py
class nullcontext(object):
"""Context manager that does no additional processing.
Used as a stand-in for a normal context manager, when a particular
block of code is only sometimes used with a normal context manager:
cm = optional_cm if condition else nullcontext()
with cm:
# Perform operation, using optional_cm if condition is True
"""
Reported by Pylint.
Line: 2
Column: 1
# Ported from python 3.7 contextlib.py
class nullcontext(object):
"""Context manager that does no additional processing.
Used as a stand-in for a normal context manager, when a particular
block of code is only sometimes used with a normal context manager:
cm = optional_cm if condition else nullcontext()
with cm:
# Perform operation, using optional_cm if condition is True
"""
Reported by Pylint.
Line: 2
Column: 1
# Ported from python 3.7 contextlib.py
class nullcontext(object):
"""Context manager that does no additional processing.
Used as a stand-in for a normal context manager, when a particular
block of code is only sometimes used with a normal context manager:
cm = optional_cm if condition else nullcontext()
with cm:
# Perform operation, using optional_cm if condition is True
"""
Reported by Pylint.
pipenv/patched/piptools/_compat/__init__.py
3 issues
Line: 7
Column: 1
import six
from .pip_compat import (
DEV_PKGS,
FAVORITE_HASH,
PIP_VERSION,
FormatControl,
InstallationCandidate,
Reported by Pylint.
Line: 40
Column: 5
)
if six.PY2:
from .tempfile import TemporaryDirectory
else:
from tempfile import TemporaryDirectory
Reported by Pylint.
Line: 1
Column: 1
# coding: utf-8
# flake8: noqa
from __future__ import absolute_import, division, print_function, unicode_literals
import six
from .pip_compat import (
DEV_PKGS,
FAVORITE_HASH,
Reported by Pylint.
pipenv/patched/piptools/__init__.py
3 issues
Line: 3
Column: 1
import locale
from piptools.click import secho
# Needed for locale.getpreferredencoding(False) to work
# in pip._internal.utils.encoding.auto_decode
try:
locale.setlocale(locale.LC_ALL, "")
except locale.Error as e: # pragma: no cover
Reported by Pylint.
Line: 1
Column: 1
import locale
from piptools.click import secho
# Needed for locale.getpreferredencoding(False) to work
# in pip._internal.utils.encoding.auto_decode
try:
locale.setlocale(locale.LC_ALL, "")
except locale.Error as e: # pragma: no cover
Reported by Pylint.
Line: 9
Column: 1
# in pip._internal.utils.encoding.auto_decode
try:
locale.setlocale(locale.LC_ALL, "")
except locale.Error as e: # pragma: no cover
# setlocale can apparently crash if locale are uninitialized
secho("Ignoring error when setting locale: {}".format(e), fg="red")
Reported by Pylint.
pipenv/vendor/plette/__init__.py
3 issues
Line: 8
Column: 1
__version__ = '0.2.3'
from .lockfiles import Lockfile
from .pipfiles import Pipfile
Reported by Pylint.
Line: 9
Column: 1
__version__ = '0.2.3'
from .lockfiles import Lockfile
from .pipfiles import Pipfile
Reported by Pylint.
Line: 1
Column: 1
__all__ = [
"__version__",
"Lockfile", "Pipfile",
]
__version__ = '0.2.3'
from .lockfiles import Lockfile
from .pipfiles import Pipfile
Reported by Pylint.
pipenv/patched/pipfile/__init__.py
3 issues
Line: 6
Column: 1
# for complete details.
from __future__ import absolute_import, division, print_function
from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
from .api import load, Pipfile
Reported by Pylint.
Line: 11
Column: 1
__uri__, __version__
)
from .api import load, Pipfile
Reported by Pylint.
Line: 1
Column: 1
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from .__about__ import (
__author__, __copyright__, __email__, __license__, __summary__, __title__,
__uri__, __version__
)
Reported by Pylint.
pipenv/vendor/pep517/colorlog.py
3 issues
Line: 35
Column: 16
curses.setupterm()
if curses.tigetnum("colors") > 0:
color = True
except Exception:
pass
return color
class LogFormatter(logging.Formatter):
Reported by Pylint.
Line: 35
Suggestion:
https://bandit.readthedocs.io/en/latest/plugins/b110_try_except_pass.html
curses.setupterm()
if curses.tigetnum("colors") > 0:
color = True
except Exception:
pass
return color
class LogFormatter(logging.Formatter):
Reported by Bandit.
Line: 111
Column: 1
return record.message + space + start_color + right_text + end_color
def enable_colourful_output(level=logging.INFO):
handler = logging.StreamHandler()
handler.setFormatter(LogFormatter())
logging.root.addHandler(handler)
logging.root.setLevel(level)
Reported by Pylint.