The following issues were found
pipenv/vendor/click_completion/lib.py
6 issues
Line: 10
Column: 1
import shlex
import click
import shellingham
from click import MultiCommand
find_unsafe = re.compile(r'[^\w@%+=:,./-]').search
Reported by Pylint.
Line: 9
Column: 1
import re
import shlex
import click
import shellingham
from click import MultiCommand
find_unsafe = re.compile(r'[^\w@%+=:,./-]').search
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from __future__ import print_function, absolute_import
import re
import shlex
import click
Reported by Pylint.
Line: 16
Column: 1
find_unsafe = re.compile(r'[^\w@%+=:,./-]').search
def single_quote(s):
"""Escape a string with single quotes in order to be parsed as a single element by shlex
Parameters
----------
s : str
Reported by Pylint.
Line: 39
Column: 1
return "'" + s.replace("'", "'\"'\"'") + "'"
def double_quote(s):
"""Escape a string with double quotes in order to be parsed as a single element by shlex
Parameters
----------
s : str
Reported by Pylint.
Line: 81
Column: 9
"""
ctx = cli.make_context(prog_name, list(args), resilient_parsing=resilient_parsing)
while ctx.args + ctx.protected_args and isinstance(ctx.command, MultiCommand):
a = ctx.protected_args + ctx.args
cmd = ctx.command.get_command(ctx, a[0])
if cmd is None:
return None
if hasattr(cmd, "no_args_is_help"):
no_args_is_help = cmd.no_args_is_help
Reported by Pylint.
pipenv/patched/notpip/_internal/models/index.py
6 issues
Line: 1
Column: 1
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
class PackageIndex(object):
"""Represents a Package Index and provides easier access to endpoints
"""
def __init__(self, url, file_storage_domain):
# type: (str, str) -> None
Reported by Pylint.
Line: 1
Column: 1
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
class PackageIndex(object):
"""Represents a Package Index and provides easier access to endpoints
"""
def __init__(self, url, file_storage_domain):
# type: (str, str) -> None
Reported by Pylint.
Line: 1
Column: 1
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
class PackageIndex(object):
"""Represents a Package Index and provides easier access to endpoints
"""
def __init__(self, url, file_storage_domain):
# type: (str, str) -> None
Reported by Pylint.
Line: 4
Column: 1
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
class PackageIndex(object):
"""Represents a Package Index and provides easier access to endpoints
"""
def __init__(self, url, file_storage_domain):
# type: (str, str) -> None
Reported by Pylint.
Line: 4
Column: 1
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
class PackageIndex(object):
"""Represents a Package Index and provides easier access to endpoints
"""
def __init__(self, url, file_storage_domain):
# type: (str, str) -> None
Reported by Pylint.
Line: 10
Column: 9
def __init__(self, url, file_storage_domain):
# type: (str, str) -> None
super(PackageIndex, self).__init__()
self.url = url
self.netloc = urllib_parse.urlsplit(url).netloc
self.simple_url = self._url_for_path('simple')
self.pypi_url = self._url_for_path('pypi')
Reported by Pylint.
pipenv/vendor/urllib3/util/timeout.py
6 issues
Line: 9
Column: 1
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
from ..exceptions import TimeoutStateError
# A sentinel value to indicate that no timeout was specified by the user in
# urllib3
_Default = object()
Reported by Pylint.
Line: 144
Column: 13
try:
float(value)
except (TypeError, ValueError):
raise ValueError(
"Timeout value %s was %s, but it must be an "
"int, float or None." % (name, value)
)
try:
Reported by Pylint.
Line: 158
Column: 13
)
except TypeError:
# Python 3
raise ValueError(
"Timeout value %s was %s, but it must be an "
"int, float or None." % (name, value)
)
return value
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import
import time
# The default socket timeout, used by httplib to indicate that no timeout was
# specified by the user
from socket import _GLOBAL_DEFAULT_TIMEOUT
from ..exceptions import TimeoutStateError
Reported by Pylint.
Line: 20
Column: 1
current_time = getattr(time, "monotonic", time.time)
class Timeout(object):
"""Timeout configuration.
Timeouts can be defined as a default for a pool:
.. code-block:: python
Reported by Pylint.
Line: 255
Column: 9
:raises urllib3.exceptions.TimeoutStateError: If :meth:`start_connect`
has not yet been called on this object.
"""
if (
self.total is not None
and self.total is not self.DEFAULT_TIMEOUT
and self._read is not None
and self._read is not self.DEFAULT_TIMEOUT
):
Reported by Pylint.
pipenv/patched/notpip/_internal/vcs/bazaar.py
6 issues
Line: 9
Column: 1
import logging
import os
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._internal.utils.misc import display_path, rmtree
from pipenv.patched.notpip._internal.utils.subprocess import make_command
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
from pipenv.patched.notpip._internal.utils.urls import path_to_url
Reported by Pylint.
Line: 9
Column: 1
import logging
import os
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
from pipenv.patched.notpip._internal.utils.misc import display_path, rmtree
from pipenv.patched.notpip._internal.utils.subprocess import make_command
from pipenv.patched.notpip._internal.utils.typing import MYPY_CHECK_RUNNING
from pipenv.patched.notpip._internal.utils.urls import path_to_url
Reported by Pylint.
Line: 1
Column: 1
# The following comment should be removed at some point in the future.
# mypy: disallow-untyped-defs=False
from __future__ import absolute_import
import logging
import os
from pipenv.patched.notpip._vendor.six.moves.urllib import parse as urllib_parse
Reported by Pylint.
Line: 26
Column: 1
logger = logging.getLogger(__name__)
class Bazaar(VersionControl):
name = 'bzr'
dirname = '.bzr'
repo_name = 'branch'
schemes = (
'bzr', 'bzr+http', 'bzr+https', 'bzr+ssh', 'bzr+sftp', 'bzr+ftp',
Reported by Pylint.
Line: 36
Column: 9
)
def __init__(self, *args, **kwargs):
super(Bazaar, self).__init__(*args, **kwargs)
# This is only needed for python <2.7.5
# Register lp but do not expose as a scheme to support bzr+lp.
if getattr(urllib_parse, 'uses_fragment', None):
urllib_parse.uses_fragment.extend(['lp'])
Reported by Pylint.
Line: 98
Column: 17
urls = cls.run_command(['info'], show_stdout=False, cwd=location)
for line in urls.splitlines():
line = line.strip()
for x in ('checkout of branch: ',
'parent branch: '):
if line.startswith(x):
repo = line.split(x)[1]
if cls._is_local_repository(repo):
return path_to_url(repo)
Reported by Pylint.
pipenv/vendor/chardet/metadata/languages.py
6 issues
Line: 14
Column: 3
from string import ascii_letters
# TODO: Add Ukranian (KOI8-U)
class Language(object):
"""Metadata about a language useful for training models
:ivar name: The human name for the language, in English.
Reported by Pylint.
Line: 16
Column: 1
# TODO: Add Ukranian (KOI8-U)
class Language(object):
"""Metadata about a language useful for training models
:ivar name: The human name for the language, in English.
:type name: str
:ivar iso_code: 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,
Reported by Pylint.
Line: 16
Column: 1
# TODO: Add Ukranian (KOI8-U)
class Language(object):
"""Metadata about a language useful for training models
:ivar name: The human name for the language, in English.
:type name: str
:ivar iso_code: 2-letter ISO 639-1 if possible, 3-letter ISO code otherwise,
Reported by Pylint.
Line: 36
Column: 5
Wikipedia for training data.
:type wiki_start_pages: list of str
"""
def __init__(self, name=None, iso_code=None, use_ascii=True, charsets=None,
alphabet=None, wiki_start_pages=None):
super(Language, self).__init__()
self.name = name
self.iso_code = iso_code
self.use_ascii = use_ascii
Reported by Pylint.
Line: 38
Column: 9
"""
def __init__(self, name=None, iso_code=None, use_ascii=True, charsets=None,
alphabet=None, wiki_start_pages=None):
super(Language, self).__init__()
self.name = name
self.iso_code = iso_code
self.use_ascii = use_ascii
self.charsets = charsets
if self.use_ascii:
Reported by Pylint.
Line: 276
Column: 1
iso_code='th',
use_ascii=False,
charsets=['ISO-8859-11', 'TIS-620', 'CP874'],
alphabet=u'กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรฤลฦวศษสหฬอฮฯะัาำิีึืฺุู฿เแโใไๅๆ็่้๊๋์ํ๎๏๐๑๒๓๔๕๖๗๘๙๚๛',
wiki_start_pages=[u'หน้าหลัก']),
'Turkish': Language(name='Turkish',
iso_code='tr',
# Q, W, and X are not used by Turkish
use_ascii=False,
Reported by Pylint.
pipenv/help.py
6 issues
Line: 1
Column: 1
import os
import pprint
import sys
import pipenv
from pipenv.pep508checker import lookup
from pipenv.vendor import pythonfinder
Reported by Pylint.
Line: 11
Column: 1
from pipenv.vendor import pythonfinder
def print_utf(line):
try:
print(line)
except UnicodeEncodeError:
print(line.encode("utf-8"))
Reported by Pylint.
Line: 18
Column: 1
print(line.encode("utf-8"))
def get_pipenv_diagnostics(project):
print("<details><summary>$ pipenv --support</summary>")
print("")
print(f"Pipenv version: `{pipenv.__version__!r}`")
print("")
print(f"Pipenv location: `{os.path.dirname(pipenv.__file__)!r}`")
Reported by Pylint.
Line: 18
Column: 1
print(line.encode("utf-8"))
def get_pipenv_diagnostics(project):
print("<details><summary>$ pipenv --support</summary>")
print("")
print(f"Pipenv version: `{pipenv.__version__!r}`")
print("")
print(f"Pipenv location: `{os.path.dirname(pipenv.__file__)!r}`")
Reported by Pylint.
Line: 66
Column: 48
print_utf(f"Contents of `Pipfile` ({project.pipfile_location!r}):")
print("")
print("```toml")
with open(project.pipfile_location) as f:
print(f.read())
print("```")
print("")
if project.lockfile_exists:
print("")
Reported by Pylint.
Line: 77
Column: 49
)
print("")
print("```json")
with open(project.lockfile_location) as f:
print(f.read())
print("```")
print("</details>")
Reported by Pylint.
pipenv/vendor/chardet/langturkishmodel.py
6 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: 4378
Column: 1
ISO_8859_9_TURKISH_MODEL = SingleByteCharSetModel(charset_name='ISO-8859-9',
language='Turkish',
char_to_order_map=ISO_8859_9_TURKISH_CHAR_TO_ORDER,
language_model=TURKISH_LANG_MODEL,
typical_positive_ratio=0.97029,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVYZabcdefghijklmnoprstuvyzÂÇÎÖÛÜâçîöûüĞğİıŞş')
Reported by Pylint.
Line: 4382
Column: 1
language_model=TURKISH_LANG_MODEL,
typical_positive_ratio=0.97029,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVYZabcdefghijklmnoprstuvyzÂÇÎÖÛÜâçîöûüĞğİıŞş')
Reported by Pylint.
Line: 4383
Column: 1
typical_positive_ratio=0.97029,
keep_ascii_letters=True,
alphabet='ABCDEFGHIJKLMNOPRSTUVYZabcdefghijklmnoprstuvyzÂÇÎÖÛÜâçîöûüĞğİıŞş')
Reported by Pylint.
pipenv/vendor/yarg/parse.py
6 issues
Line: 30
Column: 1
import requests
from .exceptions import HTTPError
def _get(pypi_server):
"""
Query the PyPI RSS feed and return a list
Reported by Pylint.
Line: 43
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b313-b320-xml-bad-elementtree
raise HTTPError(status_code=response.status_code,
reason=response.reason)
if hasattr(response.content, 'decode'):
tree = xml.etree.ElementTree.fromstring(response.content.decode())
else:
tree = xml.etree.ElementTree.fromstring(response.content)
channel = tree.find('channel')
return channel.findall('item')
Reported by Bandit.
Line: 45
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b313-b320-xml-bad-elementtree
if hasattr(response.content, 'decode'):
tree = xml.etree.ElementTree.fromstring(response.content.decode())
else:
tree = xml.etree.ElementTree.fromstring(response.content)
channel = tree.find('channel')
return channel.findall('item')
def newest_packages(
Reported by Bandit.
Line: 1
Column: 1
# -*- coding: utf-8 -*-
# (The MIT License)
#
# Copyright (c) 2014 Kura
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the 'Software'), to deal
# in the Software without restriction, including without limitation the rights
Reported by Pylint.
Line: 26
Suggestion:
https://bandit.readthedocs.io/en/latest/blacklists/blacklist_imports.html#b405-import-xml-etree
# SOFTWARE.
from datetime import datetime
import xml.etree.ElementTree
import requests
from .exceptions import HTTPError
Reported by Bandit.
Line: 98
Column: 1
return i
class Package(object):
"""
A PyPI package generated from the RSS feed information.
:param pypi_dict: A dictionary retrieved from the PyPI server.
"""
Reported by Pylint.
pipenv/patched/notpip/_vendor/html5lib/constants.py
6 issues
Line: 2943
Column: 5
class DataLossWarning(UserWarning):
"""Raised when the current tree is unable to represent the input data"""
pass
class _ReparseException(Exception):
pass
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import, division, unicode_literals
import string
EOF = None
E = {
"null-character":
"Null character in input stream, replaced with U+FFFD.",
Reported by Pylint.
Line: 1
Column: 1
from __future__ import absolute_import, division, unicode_literals
import string
EOF = None
E = {
"null-character":
"Null character in input stream, replaced with U+FFFD.",
Reported by Pylint.
Line: 522
Column: 29
"xmlns:xlink": ("xmlns", "xlink", namespaces["xmlns"])
}
unadjustForeignAttributes = dict([((ns, local), qname) for qname, (prefix, local, ns) in
adjustForeignAttributes.items()])
spaceCharacters = frozenset([
"\t",
"\n",
Reported by Pylint.
Line: 547
Column: 20
digits = frozenset(string.digits)
hexDigits = frozenset(string.hexdigits)
asciiUpper2Lower = dict([(ord(c), ord(c.lower()))
for c in string.ascii_uppercase])
# Heading elements need to be ordered
headingElements = (
"h1",
Reported by Pylint.
Line: 2937
Column: 12
tokenTypes["EmptyTag"]])
prefixes = dict([(v, k) for k, v in namespaces.items()])
prefixes["http://www.w3.org/1998/Math/MathML"] = "math"
class DataLossWarning(UserWarning):
"""Raised when the current tree is unable to represent the input data"""
Reported by Pylint.
pipenv/vendor/packaging/utils.py
6 issues
Line: 8
Column: 1
import re
from typing import FrozenSet, NewType, Tuple, Union, cast
from .tags import Tag, parse_tag
from .version import InvalidVersion, Version
BuildTag = Union[Tuple[()], Tuple[int, str]]
NormalizedName = NewType("NormalizedName", str)
Reported by Pylint.
Line: 9
Column: 1
from typing import FrozenSet, NewType, Tuple, Union, cast
from .tags import Tag, parse_tag
from .version import InvalidVersion, Version
BuildTag = Union[Tuple[()], Tuple[int, str]]
NormalizedName = NewType("NormalizedName", str)
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.
import re
from typing import FrozenSet, NewType, Tuple, Union, cast
from .tags import Tag, parse_tag
from .version import InvalidVersion, Version
Reported by Pylint.
Line: 32
Column: 1
_build_tag_regex = re.compile(r"(\d+)(.*)")
def canonicalize_name(name: str) -> NormalizedName:
# This is taken from PEP 503.
value = _canonicalize_regex.sub("-", name).lower()
return cast(NormalizedName, value)
Reported by Pylint.
Line: 81
Column: 1
return "".join(parts)
def parse_wheel_filename(
filename: str,
) -> Tuple[NormalizedName, Version, BuildTag, FrozenSet[Tag]]:
if not filename.endswith(".whl"):
raise InvalidWheelFilename(
f"Invalid wheel filename (extension must be '.whl'): {filename}"
Reported by Pylint.
Line: 117
Column: 1
return (name, version, build, tags)
def parse_sdist_filename(filename: str) -> Tuple[NormalizedName, Version]:
if filename.endswith(".tar.gz"):
file_stem = filename[: -len(".tar.gz")]
elif filename.endswith(".zip"):
file_stem = filename[: -len(".zip")]
else:
Reported by Pylint.