The following issues were found

Lib/idlelib/debugobj_r.py
9 issues
Access to a protected member _GetSubList of a client class
Error

Line: 20 Column: 20

                      return value

    def _GetSubList(self):
        sub_list = self.__item._GetSubList()
        return list(map(remote_object_tree_item, sub_list))

class StubObjectTreeItem:
    # Lives in IDLE process


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from idlelib import rpc

def remote_object_tree_item(item):
    wrapper = WrappedObjectTreeItem(item)
    oid = id(wrapper)
    rpc.objecttable[oid] = wrapper
    return oid

class WrappedObjectTreeItem:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 3 Column: 1

              from idlelib import rpc

def remote_object_tree_item(item):
    wrapper = WrappedObjectTreeItem(item)
    oid = id(wrapper)
    rpc.objecttable[oid] = wrapper
    return oid

class WrappedObjectTreeItem:

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 9 Column: 1

                  rpc.objecttable[oid] = wrapper
    return oid

class WrappedObjectTreeItem:
    # Lives in PYTHON subprocess

    def __init__(self, item):
        self.__item = item


            

Reported by Pylint.

Missing class docstring
Error

Line: 9 Column: 1

                  rpc.objecttable[oid] = wrapper
    return oid

class WrappedObjectTreeItem:
    # Lives in PYTHON subprocess

    def __init__(self, item):
        self.__item = item


            

Reported by Pylint.

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

Line: 19 Column: 5

                      value = getattr(self.__item, name)
        return value

    def _GetSubList(self):
        sub_list = self.__item._GetSubList()
        return list(map(remote_object_tree_item, sub_list))

class StubObjectTreeItem:
    # Lives in IDLE process

            

Reported by Pylint.

Missing class docstring
Error

Line: 23 Column: 1

                      sub_list = self.__item._GetSubList()
        return list(map(remote_object_tree_item, sub_list))

class StubObjectTreeItem:
    # Lives in IDLE process

    def __init__(self, sockio, oid):
        self.sockio = sockio
        self.oid = oid

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 23 Column: 1

                      sub_list = self.__item._GetSubList()
        return list(map(remote_object_tree_item, sub_list))

class StubObjectTreeItem:
    # Lives in IDLE process

    def __init__(self, sockio, oid):
        self.sockio = sockio
        self.oid = oid

            

Reported by Pylint.

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

Line: 34 Column: 5

                      value = rpc.MethodProxy(self.sockio, self.oid, name)
        return value

    def _GetSubList(self):
        sub_list = self.sockio.remotecall(self.oid, "_GetSubList", (), {})
        return [StubObjectTreeItem(self.sockio, oid) for oid in sub_list]


if __name__ == '__main__':

            

Reported by Pylint.

Lib/ctypes/macholib/dylib.py
9 issues
Missing function or method docstring
Error

Line: 45 Column: 1

                  return is_dylib.groupdict()


def test_dylib_info():
    def d(location=None, name=None, shortname=None, version=None, suffix=None):
        return dict(
            location=location,
            name=name,
            shortname=shortname,

            

Reported by Pylint.

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

Line: 46 Column: 5

              

def test_dylib_info():
    def d(location=None, name=None, shortname=None, version=None, suffix=None):
        return dict(
            location=location,
            name=name,
            shortname=shortname,
            version=version,

            

Reported by Pylint.

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

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

                          version=version,
            suffix=suffix
        )
    assert dylib_info('completely/invalid') is None
    assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')

            

Reported by Bandit.

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

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

                          suffix=suffix
        )
    assert dylib_info('completely/invalid') is None
    assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

            

Reported by Bandit.

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

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

                      )
    assert dylib_info('completely/invalid') is None
    assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')


            

Reported by Bandit.

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

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

                  assert dylib_info('completely/invalid') is None
    assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

if __name__ == '__main__':

            

Reported by Bandit.

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

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

                  assert dylib_info('completely/invalide_debug') is None
    assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

if __name__ == '__main__':
    test_dylib_info()

            

Reported by Bandit.

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

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

                  assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo')
    assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

if __name__ == '__main__':
    test_dylib_info()

            

Reported by Bandit.

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

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

                  assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug')
    assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A')
    assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A')
    assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug')

if __name__ == '__main__':
    test_dylib_info()

            

Reported by Bandit.

Lib/_py_abc.py
9 issues
No value for argument 'subclass' in unbound method call
Error

Line: 105 Column: 20

                              subclass in cls._abc_negative_cache):
                return False
            # Fall back to the subclass check.
            return cls.__subclasscheck__(subclass)
        return any(cls.__subclasscheck__(c) for c in (subclass, subtype))

    def __subclasscheck__(cls, subclass):
        """Override for issubclass(subclass, cls)."""
        if not isinstance(subclass, type):

            

Reported by Pylint.

No value for argument 'subclass' in unbound method call
Error

Line: 106 Column: 20

                              return False
            # Fall back to the subclass check.
            return cls.__subclasscheck__(subclass)
        return any(cls.__subclasscheck__(c) for c in (subclass, subtype))

    def __subclasscheck__(cls, subclass):
        """Override for issubclass(subclass, cls)."""
        if not isinstance(subclass, type):
            raise TypeError('issubclass() arg 1 must be a class')

            

Reported by Pylint.

Access to a protected member _abc_invalidation_counter of a client class
Error

Line: 11 Column: 12

                  current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.
    """
    return ABCMeta._abc_invalidation_counter


class ABCMeta(type):
    """Metaclass for defining Abstract Base Classes (ABCs).


            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from _weakrefset import WeakSet


def get_cache_token():
    """Returns the current ABC cache token.

    The token is an opaque object (supporting equality testing) identifying the
    current version of the ABC cache for virtual subclasses. The token changes
    with every call to ``register()`` on any ABC.

            

Reported by Pylint.

Metaclass class method __new__ should have 'cls' as first argument
Error

Line: 35 Column: 5

                  #       external code.
    _abc_invalidation_counter = 0

    def __new__(mcls, name, bases, namespace, /, **kwargs):
        cls = super().__new__(mcls, name, bases, namespace, **kwargs)
        # Compute set of abstract method names
        abstracts = {name
                     for name, value in namespace.items()
                     if getattr(value, "__isabstractmethod__", False)}

            

Reported by Pylint.

Redefining argument with the local name 'name'
Error

Line: 42 Column: 17

                                   for name, value in namespace.items()
                     if getattr(value, "__isabstractmethod__", False)}
        for base in bases:
            for name in getattr(base, "__abstractmethods__", set()):
                value = getattr(cls, name, None)
                if getattr(value, "__isabstractmethod__", False):
                    abstracts.add(name)
        cls.__abstractmethods__ = frozenset(abstracts)
        # Set up inheritance registry

            

Reported by Pylint.

Too many return statements (7/6)
Error

Line: 108 Column: 5

                          return cls.__subclasscheck__(subclass)
        return any(cls.__subclasscheck__(c) for c in (subclass, subtype))

    def __subclasscheck__(cls, subclass):
        """Override for issubclass(subclass, cls)."""
        if not isinstance(subclass, type):
            raise TypeError('issubclass() arg 1 must be a class')
        # Check cache
        if subclass in cls._abc_cache:

            

Reported by Pylint.

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

Line: 123 Column: 9

                      elif subclass in cls._abc_negative_cache:
            return False
        # Check the subclass hook
        ok = cls.__subclasshook__(subclass)
        if ok is not NotImplemented:
            assert isinstance(ok, bool)
            if ok:
                cls._abc_cache.add(subclass)
            else:

            

Reported by Pylint.

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

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

                      # Check the subclass hook
        ok = cls.__subclasshook__(subclass)
        if ok is not NotImplemented:
            assert isinstance(ok, bool)
            if ok:
                cls._abc_cache.add(subclass)
            else:
                cls._abc_negative_cache.add(subclass)
            return ok

            

Reported by Bandit.

Lib/lib2to3/fixes/fix_ne.py
9 issues
Attempted relative import beyond top-level package
Error

Line: 7 Column: 1

              """Fixer that turns <> into !=."""

# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base


class FixNe(fixer_base.BaseFix):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 8 Column: 1

              
# Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base


class FixNe(fixer_base.BaseFix):
    # This is so simple that we don't need the pattern compiler.

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              # Local imports
from .. import pytree
from ..pgen2 import token
from .. import fixer_base


class FixNe(fixer_base.BaseFix):
    # This is so simple that we don't need the pattern compiler.


            

Reported by Pylint.

Unused argument 'results'
Error

Line: 21 Column: 31

                      # Override
        return node.value == "<>"

    def transform(self, node, results):
        new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)
        return new

            

Reported by Pylint.

Missing class docstring
Error

Line: 12 Column: 1

              from .. import fixer_base


class FixNe(fixer_base.BaseFix):
    # This is so simple that we don't need the pattern compiler.

    _accept_type = token.NOTEQUAL

    def match(self, node):

            

Reported by Pylint.

Method could be a function
Error

Line: 17 Column: 5

              
    _accept_type = token.NOTEQUAL

    def match(self, node):
        # Override
        return node.value == "<>"

    def transform(self, node, results):
        new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 17 Column: 5

              
    _accept_type = token.NOTEQUAL

    def match(self, node):
        # Override
        return node.value == "<>"

    def transform(self, node, results):
        new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 21 Column: 5

                      # Override
        return node.value == "<>"

    def transform(self, node, results):
        new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)
        return new

            

Reported by Pylint.

Method could be a function
Error

Line: 21 Column: 5

                      # Override
        return node.value == "<>"

    def transform(self, node, results):
        new = pytree.Leaf(token.NOTEQUAL, "!=", prefix=node.prefix)
        return new

            

Reported by Pylint.

Lib/idlelib/idle_test/test_zoomheight.py
9 issues
Access to a protected member _close of a client class
Error

Line: 22 Column: 9

              
    @classmethod
    def tearDownClass(cls):
        cls.editwin._close()
        cls.root.update_idletasks()
        for id in cls.root.tk.call('after', 'info'):
            cls.root.after_cancel(id)  # Need for EditorWindow.
        cls.root.destroy()
        del cls.root

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 24 Column: 13

                  def tearDownClass(cls):
        cls.editwin._close()
        cls.root.update_idletasks()
        for id in cls.root.tk.call('after', 'info'):
            cls.root.after_cancel(id)  # Need for EditorWindow.
        cls.root.destroy()
        del cls.root

    def test_init(self):

            

Reported by Pylint.

standard import "import unittest" should be placed before "from idlelib import zoomheight"
Error

Line: 5 Column: 1

              # Some code is system dependent.

from idlelib import zoomheight
import unittest
from test.support import requires
from tkinter import Tk
from idlelib.editor import EditorWindow



            

Reported by Pylint.

standard import "from test.support import requires" should be placed before "from idlelib import zoomheight"
Error

Line: 6 Column: 1

              
from idlelib import zoomheight
import unittest
from test.support import requires
from tkinter import Tk
from idlelib.editor import EditorWindow


class Test(unittest.TestCase):

            

Reported by Pylint.

standard import "from tkinter import Tk" should be placed before "from idlelib import zoomheight"
Error

Line: 7 Column: 1

              from idlelib import zoomheight
import unittest
from test.support import requires
from tkinter import Tk
from idlelib.editor import EditorWindow


class Test(unittest.TestCase):


            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 1

              from idlelib.editor import EditorWindow


class Test(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        requires('gui')
        cls.root = Tk()

            

Reported by Pylint.

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

Line: 24 Column: 13

                  def tearDownClass(cls):
        cls.editwin._close()
        cls.root.update_idletasks()
        for id in cls.root.tk.call('after', 'info'):
            cls.root.after_cancel(id)  # Need for EditorWindow.
        cls.root.destroy()
        del cls.root

    def test_init(self):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 29 Column: 5

                      cls.root.destroy()
        del cls.root

    def test_init(self):
        zoom = zoomheight.ZoomHeight(self.editwin)
        self.assertIs(zoom.editwin, self.editwin)

    def test_zoom_height_event(self):
        zoom = zoomheight.ZoomHeight(self.editwin)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 33 Column: 5

                      zoom = zoomheight.ZoomHeight(self.editwin)
        self.assertIs(zoom.editwin, self.editwin)

    def test_zoom_height_event(self):
        zoom = zoomheight.ZoomHeight(self.editwin)
        zoom.zoom_height_event()


if __name__ == '__main__':

            

Reported by Pylint.

Lib/idlelib/idle_test/test_stackviewer.py
9 issues
Assigning result of a function call, where the function has no return
Error

Line: 39 Column: 9

                      del cls.root

    def test_init(self):
        sb = stackviewer.StackBrowser(self.root)
        isi = self.assertIsInstance
        isi(stackviewer.sc, ScrolledCanvas)
        isi(stackviewer.item, stackviewer.StackTreeItem)
        isi(stackviewer.node, TreeNode)


            

Reported by Pylint.

Unused variable 'sb'
Error

Line: 39 Column: 9

                      del cls.root

    def test_init(self):
        sb = stackviewer.StackBrowser(self.root)
        isi = self.assertIsInstance
        isi(stackviewer.sc, ScrolledCanvas)
        isi(stackviewer.item, stackviewer.StackTreeItem)
        isi(stackviewer.node, TreeNode)


            

Reported by Pylint.

standard import "import unittest" should be placed before "from idlelib import stackviewer"
Error

Line: 4 Column: 1

              "Test stackviewer, coverage 63%."

from idlelib import stackviewer
import unittest
from test.support import requires
from tkinter import Tk

from idlelib.tree import TreeNode, ScrolledCanvas
import sys

            

Reported by Pylint.

standard import "from test.support import requires" should be placed before "from idlelib import stackviewer"
Error

Line: 5 Column: 1

              
from idlelib import stackviewer
import unittest
from test.support import requires
from tkinter import Tk

from idlelib.tree import TreeNode, ScrolledCanvas
import sys


            

Reported by Pylint.

standard import "from tkinter import Tk" should be placed before "from idlelib import stackviewer"
Error

Line: 6 Column: 1

              from idlelib import stackviewer
import unittest
from test.support import requires
from tkinter import Tk

from idlelib.tree import TreeNode, ScrolledCanvas
import sys



            

Reported by Pylint.

standard import "import sys" should be placed before "from idlelib import stackviewer"
Error

Line: 9 Column: 1

              from tkinter import Tk

from idlelib.tree import TreeNode, ScrolledCanvas
import sys


class StackBrowserTest(unittest.TestCase):

    @classmethod

            

Reported by Pylint.

Missing class docstring
Error

Line: 12 Column: 1

              import sys


class StackBrowserTest(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        svs = stackviewer.sys
        try:

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 38 Column: 5

                      cls.root.destroy()
        del cls.root

    def test_init(self):
        sb = stackviewer.StackBrowser(self.root)
        isi = self.assertIsInstance
        isi(stackviewer.sc, ScrolledCanvas)
        isi(stackviewer.item, stackviewer.StackTreeItem)
        isi(stackviewer.node, TreeNode)

            

Reported by Pylint.

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

Line: 39 Column: 9

                      del cls.root

    def test_init(self):
        sb = stackviewer.StackBrowser(self.root)
        isi = self.assertIsInstance
        isi(stackviewer.sc, ScrolledCanvas)
        isi(stackviewer.item, stackviewer.StackTreeItem)
        isi(stackviewer.node, TreeNode)


            

Reported by Pylint.

Lib/distutils/tests/test_bdist_rpm.py
9 issues
Consider explicitly re-raising using the 'from' keyword
Error

Line: 31 Column: 13

                      try:
            sys.executable.encode("UTF-8")
        except UnicodeEncodeError:
            raise unittest.SkipTest("sys.executable is not encodable to UTF-8")

        super(BuildRpmTestCase, self).setUp()
        self.old_location = os.getcwd()
        self.old_sys_argv = sys.argv, sys.argv[:]


            

Reported by Pylint.

XXX I am unable yet to make this test work without
Error

Line: 43 Column: 3

                      sys.argv[:] = self.old_sys_argv[1]
        super(BuildRpmTestCase, self).tearDown()

    # XXX I am unable yet to make this test work without
    # spurious sdtout/stderr output under Mac OS X
    @unittest.skipUnless(sys.platform.startswith('linux'),
                         'spurious sdtout/stderr output under Mac OS X')
    @requires_zlib
    @unittest.skipIf(find_executable('rpm') is None,

            

Reported by Pylint.

XXX I am unable yet to make this test work without
Error

Line: 86 Column: 3

                      self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files)
        self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files)

    # XXX I am unable yet to make this test work without
    # spurious sdtout/stderr output under Mac OS X
    @unittest.skipUnless(sys.platform.startswith('linux'),
                         'spurious sdtout/stderr output under Mac OS X')
    @requires_zlib
    # http://bugs.python.org/issue1533164

            

Reported by Pylint.

Missing class docstring
Error

Line: 22 Column: 1

              
"""

class BuildRpmTestCase(support.TempdirManager,
                       support.EnvironGuard,
                       support.LoggingSilencer,
                       unittest.TestCase):

    def setUp(self):

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 33 Column: 9

                      except UnicodeEncodeError:
            raise unittest.SkipTest("sys.executable is not encodable to UTF-8")

        super(BuildRpmTestCase, self).setUp()
        self.old_location = os.getcwd()
        self.old_sys_argv = sys.argv, sys.argv[:]

    def tearDown(self):
        os.chdir(self.old_location)

            

Reported by Pylint.

Consider using Python 3 style super() without arguments
Error

Line: 41 Column: 9

                      os.chdir(self.old_location)
        sys.argv = self.old_sys_argv[0]
        sys.argv[:] = self.old_sys_argv[1]
        super(BuildRpmTestCase, self).tearDown()

    # XXX I am unable yet to make this test work without
    # spurious sdtout/stderr output under Mac OS X
    @unittest.skipUnless(sys.platform.startswith('linux'),
                         'spurious sdtout/stderr output under Mac OS X')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 52 Column: 5

                                   'the rpm command is not found')
    @unittest.skipIf(find_executable('rpmbuild') is None,
                     'the rpmbuild command is not found')
    def test_quiet(self):
        # let's create a package
        tmp_dir = self.mkdtemp()
        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
        pkg_dir = os.path.join(tmp_dir, 'foo')
        os.mkdir(pkg_dir)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 95 Column: 5

                  @unittest.skipIf(find_executable('rpm') is None,
                     'the rpm command is not found')
    @unittest.skipIf(find_executable('rpmbuild') is None,
                     'the rpmbuild command is not found')
    def test_no_optimize_flag(self):
        # let's create a package that breaks bdist_rpm
        tmp_dir = self.mkdtemp()
        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
        pkg_dir = os.path.join(tmp_dir, 'foo')

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 131 Column: 1

              
        os.remove(os.path.join(pkg_dir, 'dist', 'foo-0.1-1.noarch.rpm'))

def test_suite():
    return unittest.makeSuite(BuildRpmTestCase)

if __name__ == '__main__':
    run_unittest(test_suite())

            

Reported by Pylint.

Lib/distutils/tests/test_build_py.py
9 issues
Missing class docstring
Error

Line: 15 Column: 1

              from test.support import run_unittest


class BuildPyTestCase(support.TempdirManager,
                      support.LoggingSilencer,
                      unittest.TestCase):

    def test_package_data(self):
        sources = self.mkdtemp()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 19 Column: 5

                                    support.LoggingSilencer,
                      unittest.TestCase):

    def test_package_data(self):
        sources = self.mkdtemp()
        f = open(os.path.join(sources, "__init__.py"), "w")
        try:
            f.write("# Pretend this is a package.")
        finally:

            

Reported by Pylint.

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

Line: 21 Column: 9

              
    def test_package_data(self):
        sources = self.mkdtemp()
        f = open(os.path.join(sources, "__init__.py"), "w")
        try:
            f.write("# Pretend this is a package.")
        finally:
            f.close()
        f = open(os.path.join(sources, "README.txt"), "w")

            

Reported by Pylint.

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

Line: 26 Column: 9

                          f.write("# Pretend this is a package.")
        finally:
            f.close()
        f = open(os.path.join(sources, "README.txt"), "w")
        try:
            f.write("Info about this package")
        finally:
            f.close()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 68 Column: 5

                          self.assertIn("__init__.%s.pyc" % sys.implementation.cache_tag,
                          pyc_files)

    def test_empty_package_dir(self):
        # See bugs #1668596/#1720897
        sources = self.mkdtemp()
        open(os.path.join(sources, "__init__.py"), "w").close()

        testdir = os.path.join(sources, "doc")

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 92 Column: 5

                          self.fail("failed package_data test when package_dir is ''")

    @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
    def test_byte_compile(self):
        project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
        os.chdir(project_dir)
        self.write_file('boiledeggs.py', 'import antigravity')
        cmd = build_py(dist)
        cmd.compile = 1

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 109 Column: 5

                                       ['boiledeggs.%s.pyc' % sys.implementation.cache_tag])

    @unittest.skipIf(sys.dont_write_bytecode, 'byte-compile disabled')
    def test_byte_compile_optimized(self):
        project_dir, dist = self.create_dist(py_modules=['boiledeggs'])
        os.chdir(project_dir)
        self.write_file('boiledeggs.py', 'import antigravity')
        cmd = build_py(dist)
        cmd.compile = 0

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 157 Column: 5

                      except DistutilsFileError:
            self.fail("failed package_data when data dir includes a dir")

    def test_dont_write_bytecode(self):
        # makes sure byte_compile is not used
        dist = self.create_dist()[1]
        cmd = build_py(dist)
        cmd.compile = 1
        cmd.optimize = 1

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 175 Column: 1

                                    self.logs[0][1] % self.logs[0][2])


def test_suite():
    return unittest.makeSuite(BuildPyTestCase)

if __name__ == "__main__":
    run_unittest(test_suite())

            

Reported by Pylint.

Lib/concurrent/futures/__init__.py
9 issues
Unable to import '__init__.process'
Error

Line: 44 Column: 9

                  global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

    if name == 'ThreadPoolExecutor':
        from .thread import ThreadPoolExecutor as te

            

Reported by Pylint.

Unable to import '__init__.thread'
Error

Line: 49 Column: 9

                      return pe

    if name == 'ThreadPoolExecutor':
        from .thread import ThreadPoolExecutor as te
        ThreadPoolExecutor = te
        return te

    raise AttributeError(f"module {__name__} has no attribute {name}")

            

Reported by Pylint.

Redefining built-in 'TimeoutError'
Error

Line: 8 Column: 1

              
__author__ = 'Brian Quinlan (brian@sweetapp.com)'

from concurrent.futures._base import (FIRST_COMPLETED,
                                      FIRST_EXCEPTION,
                                      ALL_COMPLETED,
                                      CancelledError,
                                      TimeoutError,
                                      InvalidStateError,

            

Reported by Pylint.

Global variable 'ProcessPoolExecutor' undefined at the module level
Error

Line: 41 Column: 5

              

def __getattr__(name):
    global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

            

Reported by Pylint.

Global variable 'ThreadPoolExecutor' undefined at the module level
Error

Line: 41 Column: 5

              

def __getattr__(name):
    global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

            

Reported by Pylint.

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

Line: 41 Column: 5

              

def __getattr__(name):
    global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

            

Reported by Pylint.

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

Line: 41 Column: 5

              

def __getattr__(name):
    global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

            

Reported by Pylint.

Import outside toplevel (process.ProcessPoolExecutor)
Error

Line: 44 Column: 9

                  global ProcessPoolExecutor, ThreadPoolExecutor

    if name == 'ProcessPoolExecutor':
        from .process import ProcessPoolExecutor as pe
        ProcessPoolExecutor = pe
        return pe

    if name == 'ThreadPoolExecutor':
        from .thread import ThreadPoolExecutor as te

            

Reported by Pylint.

Import outside toplevel (thread.ThreadPoolExecutor)
Error

Line: 49 Column: 9

                      return pe

    if name == 'ThreadPoolExecutor':
        from .thread import ThreadPoolExecutor as te
        ThreadPoolExecutor = te
        return te

    raise AttributeError(f"module {__name__} has no attribute {name}")

            

Reported by Pylint.

Doc/tools/extensions/glossary_search.py
9 issues
Unable to import 'docutils.nodes'
Error

Line: 12 Column: 1

              """
import json
import os.path
from docutils.nodes import definition_list_item
from sphinx.addnodes import glossary
from sphinx.util import logging


logger = logging.getLogger(__name__)

            

Reported by Pylint.

Unable to import 'sphinx.addnodes'
Error

Line: 13 Column: 1

              import json
import os.path
from docutils.nodes import definition_list_item
from sphinx.addnodes import glossary
from sphinx.util import logging


logger = logging.getLogger(__name__)
STATIC_DIR = '_static'

            

Reported by Pylint.

Unable to import 'sphinx.util'
Error

Line: 14 Column: 1

              import os.path
from docutils.nodes import definition_list_item
from sphinx.addnodes import glossary
from sphinx.util import logging


logger = logging.getLogger(__name__)
STATIC_DIR = '_static'
JSON = 'glossary.json'

            

Reported by Pylint.

Unused argument 'fromdocname'
Error

Line: 22 Column: 42

              JSON = 'glossary.json'


def process_glossary_nodes(app, doctree, fromdocname):
    if app.builder.format != 'html':
        return

    terms = {}


            

Reported by Pylint.

Unused argument 'exc'
Error

Line: 44 Column: 26

                  else:
        app.env.glossary_terms = terms

def on_build_finish(app, exc):
    if not hasattr(app.env, 'glossary_terms'):
        return
    if not app.env.glossary_terms:
        return


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 22 Column: 1

              JSON = 'glossary.json'


def process_glossary_nodes(app, doctree, fromdocname):
    if app.builder.format != 'html':
        return

    terms = {}


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 44 Column: 1

                  else:
        app.env.glossary_terms = terms

def on_build_finish(app, exc):
    if not hasattr(app.env, 'glossary_terms'):
        return
    if not app.env.glossary_terms:
        return


            

Reported by Pylint.

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

Line: 55 Column: 53

                  dest_dir = os.path.join(app.outdir, STATIC_DIR)
    os.makedirs(dest_dir, exist_ok=True)

    with open(os.path.join(dest_dir, JSON), 'w') as f:
        json.dump(app.env.glossary_terms, f)


def setup(app):
    app.connect('doctree-resolved', process_glossary_nodes)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 59 Column: 1

                      json.dump(app.env.glossary_terms, f)


def setup(app):
    app.connect('doctree-resolved', process_glossary_nodes)
    app.connect('build-finished', on_build_finish)

    return {'version': '0.1', 'parallel_read_safe': True}

            

Reported by Pylint.