The following issues were found

Tools/unicode/genwincodec.py
8 issues
Redefining built-in 'map'
Error

Line: 45 Column: 5

              
def genwincodec(codepage):
    import platform
    map = genwinmap(codepage)
    encodingname = 'cp%d' % codepage
    code = codegen("", map, encodingname)
    # Replace first lines with our own docstring
    code = '''\
"""Python Character Mapping Codec %s generated on Windows:

            

Reported by Pylint.

standard import "import unicodedata" should be placed before "from gencodec import codegen"
Error

Line: 9 Column: 1

              import ctypes
from ctypes import wintypes
from gencodec import codegen
import unicodedata

def genwinmap(codepage):
    MultiByteToWideChar = ctypes.windll.kernel32.MultiByteToWideChar
    MultiByteToWideChar.argtypes = [wintypes.UINT, wintypes.DWORD,
                                    wintypes.LPCSTR, ctypes.c_int,

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 11 Column: 1

              from gencodec import codegen
import unicodedata

def genwinmap(codepage):
    MultiByteToWideChar = ctypes.windll.kernel32.MultiByteToWideChar
    MultiByteToWideChar.argtypes = [wintypes.UINT, wintypes.DWORD,
                                    wintypes.LPCSTR, ctypes.c_int,
                                    wintypes.LPWSTR, ctypes.c_int]
    MultiByteToWideChar.restype = ctypes.c_int

            

Reported by Pylint.

Variable name "MultiByteToWideChar" doesn't conform to snake_case naming style
Error

Line: 12 Column: 5

              import unicodedata

def genwinmap(codepage):
    MultiByteToWideChar = ctypes.windll.kernel32.MultiByteToWideChar
    MultiByteToWideChar.argtypes = [wintypes.UINT, wintypes.DWORD,
                                    wintypes.LPCSTR, ctypes.c_int,
                                    wintypes.LPWSTR, ctypes.c_int]
    MultiByteToWideChar.restype = ctypes.c_int


            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 29
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                          codepage, 0,
            bytes([i]), 1,
            buf, 2)
        assert ret == 1, "invalid code page"
        assert buf[1] == '\x00'
        try:
            name = unicodedata.name(buf[0])
        except ValueError:
            try:

            

Reported by Bandit.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 30
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                          bytes([i]), 1,
            buf, 2)
        assert ret == 1, "invalid code page"
        assert buf[1] == '\x00'
        try:
            name = unicodedata.name(buf[0])
        except ValueError:
            try:
                name = enc2uni[i][1]

            

Reported by Bandit.

Missing function or method docstring
Error

Line: 43 Column: 1

              
    return enc2uni

def genwincodec(codepage):
    import platform
    map = genwinmap(codepage)
    encodingname = 'cp%d' % codepage
    code = codegen("", map, encodingname)
    # Replace first lines with our own docstring

            

Reported by Pylint.

Import outside toplevel (platform)
Error

Line: 44 Column: 5

                  return enc2uni

def genwincodec(codepage):
    import platform
    map = genwinmap(codepage)
    encodingname = 'cp%d' % codepage
    code = codegen("", map, encodingname)
    # Replace first lines with our own docstring
    code = '''\

            

Reported by Pylint.

Tools/peg_generator/scripts/ast_timings.py
8 issues
Unused variable 'tree'
Error

Line: 15 Column: 13

                      try:
            with open(filename) as file:
                source = file.read()
            tree = ast.parse(source, filename)
        except Exception as err:
            print(f"{filename}: {err.__class__.__name__}: {err}", file=sys.stderr)
    tok = None
    t1 = time.time()
    dt = t1 - t0

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 16 Column: 16

                          with open(filename) as file:
                source = file.read()
            tree = ast.parse(source, filename)
        except Exception as err:
            print(f"{filename}: {err.__class__.__name__}: {err}", file=sys.stderr)
    tok = None
    t1 = time.time()
    dt = t1 - t0
    print(f"Parsed in {dt:.3f} secs", file=sys.stderr)

            

Reported by Pylint.

Unused variable 'tok'
Error

Line: 18 Column: 5

                          tree = ast.parse(source, filename)
        except Exception as err:
            print(f"{filename}: {err.__class__.__name__}: {err}", file=sys.stderr)
    tok = None
    t1 = time.time()
    dt = t1 - t0
    print(f"Parsed in {dt:.3f} secs", file=sys.stderr)
    print_memstats()


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import ast
import sys
import time

from pegen.testutil import print_memstats


def main() -> None:
    t0 = time.time()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 8 Column: 1

              from pegen.testutil import print_memstats


def main() -> None:
    t0 = time.time()
    for filename in sys.argv[1:]:
        print(filename, end="\r")
        try:
            with open(filename) as file:

            

Reported by Pylint.

Variable name "t0" doesn't conform to snake_case naming style
Error

Line: 9 Column: 5

              

def main() -> None:
    t0 = time.time()
    for filename in sys.argv[1:]:
        print(filename, end="\r")
        try:
            with open(filename) as file:
                source = file.read()

            

Reported by Pylint.

Variable name "t1" doesn't conform to snake_case naming style
Error

Line: 19 Column: 5

                      except Exception as err:
            print(f"{filename}: {err.__class__.__name__}: {err}", file=sys.stderr)
    tok = None
    t1 = time.time()
    dt = t1 - t0
    print(f"Parsed in {dt:.3f} secs", file=sys.stderr)
    print_memstats()



            

Reported by Pylint.

Variable name "dt" doesn't conform to snake_case naming style
Error

Line: 20 Column: 5

                          print(f"{filename}: {err.__class__.__name__}: {err}", file=sys.stderr)
    tok = None
    t1 = time.time()
    dt = t1 - t0
    print(f"Parsed in {dt:.3f} secs", file=sys.stderr)
    print_memstats()


if __name__ == "__main__":

            

Reported by Pylint.

Tools/scripts/rgrep.py
8 issues
Unused variable 'a'
Error

Line: 17 Column: 12

                  bufsize = 64 * 1024
    reflags = 0
    opts, args = getopt.getopt(sys.argv[1:], "i")
    for o, a in opts:
        if o == '-i':
            reflags = reflags | re.IGNORECASE
    if len(args) < 2:
        usage("not enough arguments")
    if len(args) > 2:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 13 Column: 1

              import getopt


def main():
    bufsize = 64 * 1024
    reflags = 0
    opts, args = getopt.getopt(sys.argv[1:], "i")
    for o, a in opts:
        if o == '-i':

            

Reported by Pylint.

Too many branches (14/12)
Error

Line: 13 Column: 1

              import getopt


def main():
    bufsize = 64 * 1024
    reflags = 0
    opts, args = getopt.getopt(sys.argv[1:], "i")
    for o, a in opts:
        if o == '-i':

            

Reported by Pylint.

Too many local variables (17/15)
Error

Line: 13 Column: 1

              import getopt


def main():
    bufsize = 64 * 1024
    reflags = 0
    opts, args = getopt.getopt(sys.argv[1:], "i")
    for o, a in opts:
        if o == '-i':

            

Reported by Pylint.

Variable name "a" doesn't conform to snake_case naming style
Error

Line: 17 Column: 12

                  bufsize = 64 * 1024
    reflags = 0
    opts, args = getopt.getopt(sys.argv[1:], "i")
    for o, a in opts:
        if o == '-i':
            reflags = reflags | re.IGNORECASE
    if len(args) < 2:
        usage("not enough arguments")
    if len(args) > 2:

            

Reported by Pylint.

Variable name "o" doesn't conform to snake_case naming style
Error

Line: 17 Column: 9

                  bufsize = 64 * 1024
    reflags = 0
    opts, args = getopt.getopt(sys.argv[1:], "i")
    for o, a in opts:
        if o == '-i':
            reflags = reflags | re.IGNORECASE
    if len(args) < 2:
        usage("not enough arguments")
    if len(args) > 2:

            

Reported by Pylint.

Variable name "f" doesn't conform to snake_case naming style
Error

Line: 30 Column: 9

                  except re.error as msg:
        usage("error in regular expression: %s" % msg)
    try:
        f = open(filename)
    except IOError as msg:
        usage("can't open %r: %s" % (filename, msg), 1)
    with f:
        f.seek(0, 2)
        pos = f.tell()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 59 Column: 1

                                  print(line)


def usage(msg, code=2):
    sys.stdout = sys.stderr
    print(msg)
    print(__doc__)
    sys.exit(code)


            

Reported by Pylint.

Tools/scripts/parseentities.py
8 issues
Redefining name 'text' from outer scope (line 54)
Error

Line: 19 Column: 11

              
entityRE = re.compile(r'<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|\n)+?) *-->')

def parse(text,pos=0,endpos=None):

    pos = 0
    if endpos is None:
        endpos = len(text)
    d = {}

            

Reported by Pylint.

Redefining name 'defs' from outer scope (line 58)
Error

Line: 34 Column: 17

                      pos = m.end()
    return d

def writefile(f,defs):

    f.write("entitydefs = {\n")
    items = sorted(defs.items())
    for name, (charcode,comment) in items:
        if charcode[:2] == '&#':

            

Reported by Pylint.

Multiple imports on one line (re, sys)
Error

Line: 15 Column: 1

                  Use as you like. NO WARRANTIES.

"""
import re,sys

entityRE = re.compile(r'<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|\n)+?) *-->')

def parse(text,pos=0,endpos=None):


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 19 Column: 1

              
entityRE = re.compile(r'<!ENTITY +(\w+) +CDATA +"([^"]+)" +-- +((?:.|\n)+?) *-->')

def parse(text,pos=0,endpos=None):

    pos = 0
    if endpos is None:
        endpos = len(text)
    d = {}

            

Reported by Pylint.

Variable name "d" doesn't conform to snake_case naming style
Error

Line: 24 Column: 5

                  pos = 0
    if endpos is None:
        endpos = len(text)
    d = {}
    while 1:
        m = entityRE.search(text,pos,endpos)
        if not m:
            break
        name,charcode,comment = m.groups()

            

Reported by Pylint.

Variable name "m" doesn't conform to snake_case naming style
Error

Line: 26 Column: 9

                      endpos = len(text)
    d = {}
    while 1:
        m = entityRE.search(text,pos,endpos)
        if not m:
            break
        name,charcode,comment = m.groups()
        d[name] = charcode,comment
        pos = m.end()

            

Reported by Pylint.

Argument name "f" doesn't conform to snake_case naming style
Error

Line: 34 Column: 1

                      pos = m.end()
    return d

def writefile(f,defs):

    f.write("entitydefs = {\n")
    items = sorted(defs.items())
    for name, (charcode,comment) in items:
        if charcode[:2] == '&#':

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 34 Column: 1

                      pos = m.end()
    return d

def writefile(f,defs):

    f.write("entitydefs = {\n")
    items = sorted(defs.items())
    for name, (charcode,comment) in items:
        if charcode[:2] == '&#':

            

Reported by Pylint.

Tools/scripts/diff.py
8 issues
Multiple imports on one line (sys, os, difflib, argparse)
Error

Line: 11 Column: 1

              
"""

import sys, os, difflib, argparse
from datetime import datetime, timezone

def file_mtime(path):
    t = datetime.fromtimestamp(os.stat(path).st_mtime,
                               timezone.utc)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 14 Column: 1

              import sys, os, difflib, argparse
from datetime import datetime, timezone

def file_mtime(path):
    t = datetime.fromtimestamp(os.stat(path).st_mtime,
                               timezone.utc)
    return t.astimezone().isoformat()

def main():

            

Reported by Pylint.

Variable name "t" doesn't conform to snake_case naming style
Error

Line: 15 Column: 5

              from datetime import datetime, timezone

def file_mtime(path):
    t = datetime.fromtimestamp(os.stat(path).st_mtime,
                               timezone.utc)
    return t.astimezone().isoformat()

def main():


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 19 Column: 1

                                             timezone.utc)
    return t.astimezone().isoformat()

def main():

    parser = argparse.ArgumentParser()
    parser.add_argument('-c', action='store_true', default=False,
                        help='Produce a context format diff (default)')
    parser.add_argument('-u', action='store_true', default=False,

            

Reported by Pylint.

Variable name "n" doesn't conform to snake_case naming style
Error

Line: 37 Column: 5

                  parser.add_argument('tofile')
    options = parser.parse_args()

    n = options.lines
    fromfile = options.fromfile
    tofile = options.tofile

    fromdate = file_mtime(fromfile)
    todate = file_mtime(tofile)

            

Reported by Pylint.

Variable name "ff" doesn't conform to snake_case naming style
Error

Line: 43 Column: 28

              
    fromdate = file_mtime(fromfile)
    todate = file_mtime(tofile)
    with open(fromfile) as ff:
        fromlines = ff.readlines()
    with open(tofile) as tf:
        tolines = tf.readlines()

    if options.u:

            

Reported by Pylint.

Variable name "tf" doesn't conform to snake_case naming style
Error

Line: 45 Column: 26

                  todate = file_mtime(tofile)
    with open(fromfile) as ff:
        fromlines = ff.readlines()
    with open(tofile) as tf:
        tolines = tf.readlines()

    if options.u:
        diff = difflib.unified_diff(fromlines, tolines, fromfile, tofile, fromdate, todate, n=n)
    elif options.n:

            

Reported by Pylint.

Line too long (107/100)
Error

Line: 53 Column: 1

                  elif options.n:
        diff = difflib.ndiff(fromlines, tolines)
    elif options.m:
        diff = difflib.HtmlDiff().make_file(fromlines,tolines,fromfile,tofile,context=options.c,numlines=n)
    else:
        diff = difflib.context_diff(fromlines, tolines, fromfile, tofile, fromdate, todate, n=n)

    sys.stdout.writelines(diff)


            

Reported by Pylint.

Lib/test/crashers/underlying_dict.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              import gc

thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 4 Column: 1

              import gc

thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)

            

Reported by Pylint.

Class 'A' inherits from object, can be safely removed from bases in python3
Error

Line: 4 Column: 1

              import gc

thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)

            

Reported by Pylint.

Class name "A" doesn't conform to PascalCase naming style
Error

Line: 4 Column: 1

              import gc

thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)

            

Reported by Pylint.

Missing class docstring
Error

Line: 4 Column: 1

              import gc

thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)

            

Reported by Pylint.

Method name "f" doesn't conform to snake_case naming style
Error

Line: 5 Column: 5

              
thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)
if "__module__" in r[0]:

            

Reported by Pylint.

Method could be a function
Error

Line: 5 Column: 5

              
thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)
if "__module__" in r[0]:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 5

              
thingy = object()
class A(object):
    def f(self):
        return 1
    x = thingy

r = gc.get_referrers(thingy)
if "__module__" in r[0]:

            

Reported by Pylint.

Lib/test/badsyntax_future4.py
8 issues
Unused import __future__
Error

Line: 2 Column: 1

              """This is a test"""
import __future__
from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g


            

Reported by Pylint.

__future__ import is not the first non docstring statement
Error

Line: 3 Column: 1

              """This is a test"""
import __future__
from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

              import __future__
from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g

result = f(2)(4)

            

Reported by Pylint.

Argument name "x" doesn't conform to snake_case naming style
Error

Line: 5 Column: 1

              import __future__
from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g

result = f(2)(4)

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 5 Column: 1

              import __future__
from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g

result = f(2)(4)

            

Reported by Pylint.

Argument name "y" doesn't conform to snake_case naming style
Error

Line: 6 Column: 5

              from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g

result = f(2)(4)

            

Reported by Pylint.

Function name "g" doesn't conform to snake_case naming style
Error

Line: 6 Column: 5

              from __future__ import nested_scopes

def f(x):
    def g(y):
        return x + y
    return g

result = f(2)(4)

            

Reported by Pylint.

Constant name "result" doesn't conform to UPPER_CASE naming style
Error

Line: 10 Column: 1

                      return x + y
    return g

result = f(2)(4)

            

Reported by Pylint.

Lib/test/dtracedata/instance.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              import gc

class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 3 Column: 1

              import gc

class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a

            

Reported by Pylint.

Class name "old_style_class" doesn't conform to PascalCase naming style
Error

Line: 3 Column: 1

              import gc

class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a

            

Reported by Pylint.

Missing class docstring
Error

Line: 3 Column: 1

              import gc

class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 5 Column: 1

              
class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a
gc.collect()

            

Reported by Pylint.

Class name "new_style_class" doesn't conform to PascalCase naming style
Error

Line: 5 Column: 1

              
class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a
gc.collect()

            

Reported by Pylint.

Missing class docstring
Error

Line: 5 Column: 1

              
class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a
gc.collect()

            

Reported by Pylint.

Class 'new_style_class' inherits from object, can be safely removed from bases in python3
Error

Line: 5 Column: 1

              
class old_style_class():
    pass
class new_style_class(object):
    pass

a = old_style_class()
del a
gc.collect()

            

Reported by Pylint.

Lib/test/test_generator_stop.py
8 issues
Missing module docstring
Error

Line: 1 Column: 1

              from __future__ import generator_stop

import unittest


class TestPEP479(unittest.TestCase):
    def test_stopiteration_wrapping(self):
        def f():
            raise StopIteration

            

Reported by Pylint.

Missing class docstring
Error

Line: 6 Column: 1

              import unittest


class TestPEP479(unittest.TestCase):
    def test_stopiteration_wrapping(self):
        def f():
            raise StopIteration
        def g():
            yield f()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 5

              

class TestPEP479(unittest.TestCase):
    def test_stopiteration_wrapping(self):
        def f():
            raise StopIteration
        def g():
            yield f()
        with self.assertRaisesRegex(RuntimeError,

            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 8 Column: 9

              
class TestPEP479(unittest.TestCase):
    def test_stopiteration_wrapping(self):
        def f():
            raise StopIteration
        def g():
            yield f()
        with self.assertRaisesRegex(RuntimeError,
                                    "generator raised StopIteration"):

            

Reported by Pylint.

Function name "g" doesn't conform to snake_case naming style
Error

Line: 10 Column: 9

                  def test_stopiteration_wrapping(self):
        def f():
            raise StopIteration
        def g():
            yield f()
        with self.assertRaisesRegex(RuntimeError,
                                    "generator raised StopIteration"):
            next(g())


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 16 Column: 5

                                                  "generator raised StopIteration"):
            next(g())

    def test_stopiteration_wrapping_context(self):
        def f():
            raise StopIteration
        def g():
            yield f()


            

Reported by Pylint.

Function name "f" doesn't conform to snake_case naming style
Error

Line: 17 Column: 9

                          next(g())

    def test_stopiteration_wrapping_context(self):
        def f():
            raise StopIteration
        def g():
            yield f()

        try:

            

Reported by Pylint.

Function name "g" doesn't conform to snake_case naming style
Error

Line: 19 Column: 9

                  def test_stopiteration_wrapping_context(self):
        def f():
            raise StopIteration
        def g():
            yield f()

        try:
            next(g())
        except RuntimeError as exc:

            

Reported by Pylint.

Lib/test/test_importlib/extension/test_case_sensitivity.py
8 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              from test.support import os_helper
import unittest
import sys
from .. import util

importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')



            

Reported by Pylint.

Unused _bootstrap_external imported from importlib
Error

Line: 1 Column: 1

              from importlib import _bootstrap_external
from test.support import os_helper
import unittest
import sys
from .. import util

importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from importlib import _bootstrap_external
from test.support import os_helper
import unittest
import sys
from .. import util

importlib = util.import_importlib('importlib')
machinery = util.import_importlib('importlib.machinery')


            

Reported by Pylint.

Missing class docstring
Error

Line: 13 Column: 1

              
@unittest.skipIf(util.EXTENSIONS.filename is None, '_testcapi not available')
@util.case_insensitive_tests
class ExtensionModuleCaseSensitivityTest(util.CASEOKTestBase):

    def find_spec(self):
        good_name = util.EXTENSIONS.name
        bad_name = good_name.upper()
        assert good_name != bad_name

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 15 Column: 5

              @util.case_insensitive_tests
class ExtensionModuleCaseSensitivityTest(util.CASEOKTestBase):

    def find_spec(self):
        good_name = util.EXTENSIONS.name
        bad_name = good_name.upper()
        assert good_name != bad_name
        finder = self.machinery.FileFinder(util.EXTENSIONS.path,
                                          (self.machinery.ExtensionFileLoader,

            

Reported by Pylint.

Use of assert detected. The enclosed code will be removed when compiling to optimised byte code.
Security

Line: 18
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b101_assert_used.html

                  def find_spec(self):
        good_name = util.EXTENSIONS.name
        bad_name = good_name.upper()
        assert good_name != bad_name
        finder = self.machinery.FileFinder(util.EXTENSIONS.path,
                                          (self.machinery.ExtensionFileLoader,
                                           self.machinery.EXTENSION_SUFFIXES))
        return finder.find_spec(bad_name)


            

Reported by Bandit.

Missing function or method docstring
Error

Line: 25 Column: 5

                      return finder.find_spec(bad_name)

    @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set')
    def test_case_sensitive(self):
        with os_helper.EnvironmentVarGuard() as env:
            env.unset('PYTHONCASEOK')
            self.caseok_env_changed(should_exist=False)
            spec = self.find_spec()
            self.assertIsNone(spec)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 5

                          self.assertIsNone(spec)

    @unittest.skipIf(sys.flags.ignore_environment, 'ignore_environment flag was set')
    def test_case_insensitivity(self):
        with os_helper.EnvironmentVarGuard() as env:
            env.set('PYTHONCASEOK', '1')
            self.caseok_env_changed(should_exist=True)
            spec = self.find_spec()
            self.assertTrue(spec)

            

Reported by Pylint.