The following issues were found

Lib/test/test_list.py
84 issues
XXX If/when PySequence_Length() returns a ssize_t, it should be
Error

Line: 25 Column: 3

              
        if sys.maxsize == 0x7fffffff:
            # This test can currently only work on 32-bit machines.
            # XXX If/when PySequence_Length() returns a ssize_t, it should be
            # XXX re-enabled.
            # Verify clearing of bug #556025.
            # This assumes that the max data size (sys.maxint) == max
            # address size this also assumes that the address size is at
            # least 4 bytes with 8 byte addresses, the bug is not well

            

Reported by Pylint.

XXX re-enabled.
Error

Line: 26 Column: 3

                      if sys.maxsize == 0x7fffffff:
            # This test can currently only work on 32-bit machines.
            # XXX If/when PySequence_Length() returns a ssize_t, it should be
            # XXX re-enabled.
            # Verify clearing of bug #556025.
            # This assumes that the max data size (sys.maxint) == max
            # address size this also assumes that the address size is at
            # least 4 bytes with 8 byte addresses, the bug is not well
            # tested

            

Reported by Pylint.

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Security blacklist

Line: 88
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle

                          # initial iterator
            itorig = iter(orig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))
            self.assertEqual(list(it), data)

            # running iterator

            

Reported by Bandit.

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Security blacklist

Line: 96
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle

                          # running iterator
            next(itorig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))
            self.assertEqual(list(it), data[1:])

            # empty iterator

            

Reported by Bandit.

Unused variable 'i'
Error

Line: 102 Column: 17

                          self.assertEqual(list(it), data[1:])

            # empty iterator
            for i in range(1, len(orig)):
                next(itorig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))

            

Reported by Pylint.

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Security blacklist

Line: 105
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle

                          for i in range(1, len(orig)):
                next(itorig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))
            self.assertEqual(list(it), data[len(orig):])

            # exhausted iterator

            

Reported by Bandit.

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Security blacklist

Line: 113
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle

                          # exhausted iterator
            self.assertRaises(StopIteration, next, itorig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(list(it), [])

    def test_reversed_pickle(self):
        orig = self.type2test([4, 5, 6, 7])

            

Reported by Bandit.

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Security blacklist

Line: 124
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle

                          # initial iterator
            itorig = reversed(orig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))
            self.assertEqual(list(it), data[len(orig)-1::-1])

            # running iterator

            

Reported by Bandit.

Pickle and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue.
Security blacklist

Line: 132
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b301-pickle

                          # running iterator
            next(itorig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))
            self.assertEqual(list(it), data[len(orig)-2::-1])

            # empty iterator

            

Reported by Bandit.

Unused variable 'i'
Error

Line: 138 Column: 17

                          self.assertEqual(list(it), data[len(orig)-2::-1])

            # empty iterator
            for i in range(1, len(orig)):
                next(itorig)
            d = pickle.dumps((itorig, orig), proto)
            it, a = pickle.loads(d)
            a[:] = data
            self.assertEqual(type(it), type(itorig))

            

Reported by Pylint.

Lib/xmlrpc/server.py
84 issues
Cannot import 'traceback' due to syntax error 'invalid syntax (<unknown>, line 576)'
Error

Line: 118 Column: 1

              import os
import re
import pydoc
import traceback
try:
    import fcntl
except ImportError:
    fcntl = None


            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'system_listMethods' member
Error

Line: 862 Column: 28

              
        methods = {}

        for method_name in self.system_listMethods():
            if method_name in self.funcs:
                method = self.funcs[method_name]
            elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'funcs' member
Error

Line: 863 Column: 31

                      methods = {}

        for method_name in self.system_listMethods():
            if method_name in self.funcs:
                method = self.funcs[method_name]
            elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'funcs' member
Error

Line: 864 Column: 26

              
        for method_name in self.system_listMethods():
            if method_name in self.funcs:
                method = self.funcs[method_name]
            elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'instance' member
Error

Line: 865 Column: 18

                      for method_name in self.system_listMethods():
            if method_name in self.funcs:
                method = self.funcs[method_name]
            elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):
                    method_info[1] = self.instance._methodHelp(method_name)

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'instance' member
Error

Line: 867 Column: 28

                              method = self.funcs[method_name]
            elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):
                    method_info[1] = self.instance._methodHelp(method_name)

                method_info = tuple(method_info)

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'instance' member
Error

Line: 868 Column: 38

                          elif self.instance is not None:
                method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):
                    method_info[1] = self.instance._methodHelp(method_name)

                method_info = tuple(method_info)
                if method_info != (None, None):

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'instance' member
Error

Line: 869 Column: 28

                              method_info = [None, None] # argspec, documentation
                if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):
                    method_info[1] = self.instance._methodHelp(method_name)

                method_info = tuple(method_info)
                if method_info != (None, None):
                    method = method_info

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'instance' member
Error

Line: 870 Column: 38

                              if hasattr(self.instance, '_get_method_argstring'):
                    method_info[0] = self.instance._get_method_argstring(method_name)
                if hasattr(self.instance, '_methodHelp'):
                    method_info[1] = self.instance._methodHelp(method_name)

                method_info = tuple(method_info)
                if method_info != (None, None):
                    method = method_info
                elif not hasattr(self.instance, '_dispatch'):

            

Reported by Pylint.

Instance of 'XMLRPCDocGenerator' has no 'instance' member
Error

Line: 875 Column: 34

                              method_info = tuple(method_info)
                if method_info != (None, None):
                    method = method_info
                elif not hasattr(self.instance, '_dispatch'):
                    try:
                        method = resolve_dotted_attribute(
                                    self.instance,
                                    method_name
                                    )

            

Reported by Pylint.

Lib/zoneinfo/_zoneinfo.py
84 issues
Attempted relative import beyond top-level package
Error

Line: 9 Column: 1

              import weakref
from datetime import datetime, timedelta, tzinfo

from . import _common, _tzpath

EPOCH = datetime(1970, 1, 1)
EPOCHORDINAL = datetime(1970, 1, 1).toordinal()

# It is relatively expensive to construct new timedelta objects, and in most

            

Reported by Pylint.

Access to a protected member _from_cache of a client class
Error

Line: 57 Column: 9

                  @classmethod
    def no_cache(cls, key):
        obj = cls._new_instance(key)
        obj._from_cache = False

        return obj

    @classmethod
    def _new_instance(cls, key):

            

Reported by Pylint.

Access to a protected member _key of a client class
Error

Line: 64 Column: 9

                  @classmethod
    def _new_instance(cls, key):
        obj = super().__new__(cls)
        obj._key = key
        obj._file_path = obj._find_tzfile(key)

        if obj._file_path is not None:
            file_obj = open(obj._file_path, "rb")
        else:

            

Reported by Pylint.

Access to a protected member _find_tzfile of a client class
Error

Line: 65 Column: 26

                  def _new_instance(cls, key):
        obj = super().__new__(cls)
        obj._key = key
        obj._file_path = obj._find_tzfile(key)

        if obj._file_path is not None:
            file_obj = open(obj._file_path, "rb")
        else:
            file_obj = _common.load_tzdata(key)

            

Reported by Pylint.

Access to a protected member _file_path of a client class
Error

Line: 65 Column: 9

                  def _new_instance(cls, key):
        obj = super().__new__(cls)
        obj._key = key
        obj._file_path = obj._find_tzfile(key)

        if obj._file_path is not None:
            file_obj = open(obj._file_path, "rb")
        else:
            file_obj = _common.load_tzdata(key)

            

Reported by Pylint.

Access to a protected member _file_path of a client class
Error

Line: 67 Column: 12

                      obj._key = key
        obj._file_path = obj._find_tzfile(key)

        if obj._file_path is not None:
            file_obj = open(obj._file_path, "rb")
        else:
            file_obj = _common.load_tzdata(key)

        with file_obj as f:

            

Reported by Pylint.

Access to a protected member _file_path of a client class
Error

Line: 68 Column: 29

                      obj._file_path = obj._find_tzfile(key)

        if obj._file_path is not None:
            file_obj = open(obj._file_path, "rb")
        else:
            file_obj = _common.load_tzdata(key)

        with file_obj as f:
            obj._load_file(f)

            

Reported by Pylint.

Access to a protected member _load_file of a client class
Error

Line: 73 Column: 13

                          file_obj = _common.load_tzdata(key)

        with file_obj as f:
            obj._load_file(f)

        return obj

    @classmethod
    def from_file(cls, fobj, /, key=None):

            

Reported by Pylint.

Access to a protected member _key of a client class
Error

Line: 80 Column: 9

                  @classmethod
    def from_file(cls, fobj, /, key=None):
        obj = super().__new__(cls)
        obj._key = key
        obj._file_path = None
        obj._load_file(fobj)
        obj._file_repr = repr(fobj)

        # Disable pickling for objects created from files

            

Reported by Pylint.

Access to a protected member _file_path of a client class
Error

Line: 81 Column: 9

                  def from_file(cls, fobj, /, key=None):
        obj = super().__new__(cls)
        obj._key = key
        obj._file_path = None
        obj._load_file(fobj)
        obj._file_repr = repr(fobj)

        # Disable pickling for objects created from files
        obj.__reduce__ = obj._file_reduce

            

Reported by Pylint.

Tools/scripts/byteyears.py
84 issues
Unused import S_ISDIR from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IXOTH from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IWOTH from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IROTH from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IRWXO from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IXGRP from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IWGRP from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IRGRP from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IRWXG from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Unused import S_IXUSR from wildcard import
Error

Line: 10 Column: 1

              # Options -[amc] select atime, mtime (default) or ctime as age.

import sys, os, time
from stat import *

def main():

    # Use lstat() to stat files if it exists, else stat()
    try:

            

Reported by Pylint.

Lib/idlelib/configdialog.py
84 issues
Unused Scale imported from tkinter
Error

Line: 14 Column: 1

              """
import re

from tkinter import (Toplevel, Listbox, Scale, Canvas,
                     StringVar, BooleanVar, IntVar, TRUE, FALSE,
                     TOP, BOTTOM, RIGHT, LEFT, SOLID, GROOVE,
                     NONE, BOTH, X, Y, W, E, EW, NS, NSEW, NW,
                     HORIZONTAL, VERTICAL, ANCHOR, ACTIVE, END, TclError)
from tkinter.ttk import (Frame, LabelFrame, Button, Checkbutton, Entry, Label,

            

Reported by Pylint.

XXX Decide whether to keep or delete these key bindings.
Error

Line: 83 Column: 3

                      self.transient(parent)
        self.protocol("WM_DELETE_WINDOW", self.cancel)
        self.fontpage.fontlist.focus_set()
        # XXX Decide whether to keep or delete these key bindings.
        # Key bindings for this dialog.
        # self.bind('<Escape>', self.Cancel) #dismiss dialog, no save
        # self.bind('<Alt-a>', self.Apply) #apply changes, save
        # self.bind('<F1>', self.Help) #context help
        # Attach callbacks after loading config to avoid calling them.

            

Reported by Pylint.

Attribute 'buttons' defined outside __init__
Error

Line: 160 Column: 9

                          padding_args = {'padding': (6, 3)}
        outer = Frame(self.frame, padding=2)
        buttons_frame = Frame(outer, padding=2)
        self.buttons = {}
        for txt, cmd in (
            ('Ok', self.ok),
            ('Apply', self.apply),
            ('Cancel', self.cancel),
            ('Help', self.help)):

            

Reported by Pylint.

Using the global statement
Error

Line: 196 Column: 9

                      self.destroy()

    def destroy(self):
        global font_sample_text
        font_sample_text = self.fontpage.font_sample.get('1.0', 'end')
        self.grab_release()
        super().destroy()

    def help(self):

            

Reported by Pylint.

Unused argument 'params'
Error

Line: 419 Column: 1

                      self.font_bold.set(font_bold)
        self.set_samples()

    def var_changed_font(self, *params):
        """Store changes to font attributes.

        When one font attribute changes, save them all, as they are
        not independent from each other. In particular, when we are
        overriding the default font, we need to write out everything.

            

Reported by Pylint.

Unused argument 'event'
Error

Line: 444 Column: 27

                              ACTIVE if event.type.name == 'KeyRelease' else ANCHOR)
        self.font_name.set(font.lower())

    def set_samples(self, event=None):
        """Update update both screen samples with the font settings.

        Called on font initialization and change events.
        Accesses font_name, font_size, and font_bold Variables.
        Updates font_sample and highlight page highlight_sample.

            

Reported by Pylint.

Unused argument 'event'
Error

Line: 657 Column: 21

                                      f'{lineno:{len(str(n_lines))}d} ',
                        'linenumber')
        for element in self.theme_elements:
            def tem(event, elem=element):
                # event.widget.winfo_top_level().highlight_target.set(elem)
                self.highlight_target.set(elem)
            text.tag_bind(
                    self.theme_elements[element][0], '<ButtonPress-1>', tem)
        text['state'] = 'disabled'

            

Reported by Pylint.

Unused argument 'params'
Error

Line: 774 Column: 1

                      self.paint_theme_sample()
        self.set_highlight_target()

    def var_changed_builtin_name(self, *params):
        """Process new builtin theme selection.

        Add the changed theme's name to the changed_items and recreate
        the sample with the values from the selected theme.
        """

            

Reported by Pylint.

Unused argument 'params'
Error

Line: 793 Column: 1

                          self.theme_message['text'] = ''
        self.paint_theme_sample()

    def var_changed_custom_name(self, *params):
        """Process new custom theme selection.

        If a new custom theme is selected, add the name to the
        changed_items and apply the theme to the sample.
        """

            

Reported by Pylint.

Unused argument 'params'
Error

Line: 804 Column: 1

                          changes.add_option('main', 'Theme', 'name', value)
            self.paint_theme_sample()

    def var_changed_theme_source(self, *params):
        """Process toggle between builtin and custom theme.

        Update the default toggle value and apply the newly
        selected theme type.
        """

            

Reported by Pylint.

Lib/idlelib/idle_test/test_sidebar.py
84 issues
Attribute 'vbar' defined outside __init__
Error

Line: 54 Column: 9

                      cls.text.grid(row=1, column=1, sticky=tk.NSEW)

        cls.editwin = Dummy_editwin(cls.text)
        cls.editwin.vbar = tk.Scrollbar(cls.text_frame)

    @classmethod
    def tearDownClass(cls):
        cls.editwin.per.close()
        cls.root.update()

            

Reported by Pylint.

Unused argument 'root'
Error

Line: 79 Column: 35

                      self.addCleanup(GetHighlight_patcher.stop)

        self.font_override = 'TkFixedFont'
        def mock_idleconf_GetFont(root, configType, section):
            return self.font_override
        GetFont_patcher = unittest.mock.patch.object(
            idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont)
        GetFont_patcher.start()
        self.addCleanup(GetFont_patcher.stop)

            

Reported by Pylint.

Unused argument 'section'
Error

Line: 79 Column: 53

                      self.addCleanup(GetHighlight_patcher.stop)

        self.font_override = 'TkFixedFont'
        def mock_idleconf_GetFont(root, configType, section):
            return self.font_override
        GetFont_patcher = unittest.mock.patch.object(
            idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont)
        GetFont_patcher.start()
        self.addCleanup(GetFont_patcher.stop)

            

Reported by Pylint.

Unused argument 'configType'
Error

Line: 79 Column: 41

                      self.addCleanup(GetHighlight_patcher.stop)

        self.font_override = 'TkFixedFont'
        def mock_idleconf_GetFont(root, configType, section):
            return self.font_override
        GetFont_patcher = unittest.mock.patch.object(
            idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont)
        GetFont_patcher.start()
        self.addCleanup(GetFont_patcher.stop)

            

Reported by Pylint.

TODO: Re-work these tests or remove them from the test suite.
Error

Line: 257 Column: 3

                  # are fragile and can fail when several GUI tests are run in parallel
    # or when the windows created by the test lose focus.
    #
    # TODO: Re-work these tests or remove them from the test suite.

    @unittest.skip('test disabled')
    def test_click_selection(self):
        self.linenumber.show_sidebar()
        self.text.insert('1.0', 'one\ntwo\nthree\nfour\n')

            

Reported by Pylint.

Unused variable 'flist'
Error

Line: 408 Column: 21

                      fixwordbreaks(root)
        fix_x11_paste(root)

        cls.flist = flist = PyShellFileList(root)
        # See #43981 about macosx.setupApp(root, flist) causing failure.
        root.update_idletasks()

        cls.init_shell()


            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 497 Column: 24

                          set(self.get_shell_line_y_coords()),
        )

    def do_input(self, input):
        shell = self.shell
        text = shell.text
        for line_index, line in enumerate(input.split('\n')):
            if line_index > 0:
                text.event_generate('<<newline-and-indent>>')

            

Reported by Pylint.

Using an f-string that does not have any interpolated variables
Error

Line: 559 Column: 33

                      yield
        self.assert_sidebar_lines_end_with(['>>>', None, None, None, '>>>'])

        text.mark_set('insert', f'insert -1line linestart')
        text.event_generate('<<squeeze-current-text>>')
        yield
        self.assert_sidebar_lines_end_with(['>>>', None, '>>>'])
        self.assert_sidebar_lines_synced()


            

Reported by Pylint.

Unused argument 'configType'
Error

Line: 628 Column: 41

              
        test_font = 'TkTextFont'

        def mock_idleconf_GetFont(root, configType, section):
            return test_font
        GetFont_patcher = unittest.mock.patch.object(
            idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont)
        GetFont_patcher.start()
        def cleanup():

            

Reported by Pylint.

Unused argument 'section'
Error

Line: 628 Column: 53

              
        test_font = 'TkTextFont'

        def mock_idleconf_GetFont(root, configType, section):
            return test_font
        GetFont_patcher = unittest.mock.patch.object(
            idlelib.sidebar.idleConf, 'GetFont', mock_idleconf_GetFont)
        GetFont_patcher.start()
        def cleanup():

            

Reported by Pylint.

Lib/test/test_asyncio/utils.py
83 issues
Access to a protected member _log_destroy_pending of a client class
Error

Line: 104 Column: 5

                  t = loop.create_task(gen)
    # Don't log a warning if the task is not done after run_until_complete().
    # It occurs if the loop is stopped or if a task raises a BaseException.
    t._log_destroy_pending = False
    try:
        loop.run_until_complete(t)
    finally:
        gen.close()


            

Reported by Pylint.

Redefining built-in 'format'
Error

Line: 137 Column: 27

                  def get_stderr(self):
        return io.StringIO()

    def log_message(self, format, *args):
        pass


class SilentWSGIServer(WSGIServer):


            

Reported by Pylint.

Unused variable 'client_addr'
Error

Line: 231 Column: 22

                          self.setup_environ()

        def get_request(self):
            request, client_addr = super().get_request()
            request.settimeout(self.request_timeout)
            # Code in the stdlib expects that get_request
            # will return a socket and a tuple (host, port).
            # However, this isn't true for UNIX sockets,
            # as the second return value will be a path;

            

Reported by Pylint.

Redefining name 'events' from outer scope (line 31)
Error

Line: 299 Column: 33

                  def __init__(self):
        self.keys = {}

    def register(self, fileobj, events, data=None):
        key = selectors.SelectorKey(fileobj, 0, events, data)
        self.keys[fileobj] = key
        return key

    def unregister(self, fileobj):

            

Reported by Pylint.

Signature differs from overridden 'select' method
Error

Line: 307 Column: 5

                  def unregister(self, fileobj):
        return self.keys.pop(fileobj)

    def select(self, timeout):
        return []

    def get_map(self):
        return self.keys


            

Reported by Pylint.

Access to a protected member _callback of a client class
Error

Line: 389 Column: 12

                      if fd not in self.readers:
            raise AssertionError(f'fd {fd} is not registered')
        handle = self.readers[fd]
        if handle._callback != callback:
            raise AssertionError(
                f'unexpected callback: {handle._callback} != {callback}')
        if handle._args != args:
            raise AssertionError(
                f'unexpected callback args: {handle._args} != {args}')

            

Reported by Pylint.

Access to a protected member _callback of a client class
Error

Line: 391 Column: 41

                      handle = self.readers[fd]
        if handle._callback != callback:
            raise AssertionError(
                f'unexpected callback: {handle._callback} != {callback}')
        if handle._args != args:
            raise AssertionError(
                f'unexpected callback args: {handle._args} != {args}')

    def assert_no_reader(self, fd):

            

Reported by Pylint.

Access to a protected member _args of a client class
Error

Line: 392 Column: 12

                      if handle._callback != callback:
            raise AssertionError(
                f'unexpected callback: {handle._callback} != {callback}')
        if handle._args != args:
            raise AssertionError(
                f'unexpected callback args: {handle._args} != {args}')

    def assert_no_reader(self, fd):
        if fd in self.readers:

            

Reported by Pylint.

Access to a protected member _args of a client class
Error

Line: 394 Column: 46

                              f'unexpected callback: {handle._callback} != {callback}')
        if handle._args != args:
            raise AssertionError(
                f'unexpected callback args: {handle._args} != {args}')

    def assert_no_reader(self, fd):
        if fd in self.readers:
            raise AssertionError(f'fd {fd} is registered')


            

Reported by Pylint.

Access to a protected member _callback of a client class
Error

Line: 414 Column: 16

                  def assert_writer(self, fd, callback, *args):
        assert fd in self.writers, 'fd {} is not registered'.format(fd)
        handle = self.writers[fd]
        assert handle._callback == callback, '{!r} != {!r}'.format(
            handle._callback, callback)
        assert handle._args == args, '{!r} != {!r}'.format(
            handle._args, args)

    def _ensure_fd_no_transport(self, fd):

            

Reported by Pylint.

Lib/ctypes/test/test_unaligned_structures.py
83 issues
Unused import string_at from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import cdll from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import LibraryLoader from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import OleDLL from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import HRESULT from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import WinDLL from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import PyDLL from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import CDLL from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import ARRAY from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Unused import SetPointerType from wildcard import
Error

Line: 2 Column: 1

              import sys, unittest
from ctypes import *

structures = []
byteswapped_structures = []


if sys.byteorder == "little":
    SwappedStructure = BigEndianStructure

            

Reported by Pylint.

Lib/ctypes/test/test_returnfuncptrs.py
83 issues
Unused import BigEndianStructure from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import get_errno from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import set_errno from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import POINTER from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import pointer from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import get_last_error from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import set_last_error from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import LittleEndianStructure from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Wildcard import ctypes
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Unused import DEFAULT_MODE from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *

import _ctypes_test

class ReturnFuncPtrTestCase(unittest.TestCase):

    def test_with_prototype(self):
        # The _ctypes_test shared lib/dll exports quite some functions for testing.

            

Reported by Pylint.

Lib/turtledemo/lindenmayer.py
83 issues
Undefined variable 'right'
Error

Line: 56 Column: 9

              

    def r():
        right(45)

    def l():
        left(45)

    def f():

            

Reported by Pylint.

Undefined variable 'left'
Error

Line: 59 Column: 9

                      right(45)

    def l():
        left(45)

    def f():
        forward(7.5)

    snake_rules = {"-":r, "+":l, "f":f, "b":"f+f+f--f--f+f+f"}

            

Reported by Pylint.

Undefined variable 'forward'
Error

Line: 62 Column: 9

                      left(45)

    def f():
        forward(7.5)

    snake_rules = {"-":r, "+":l, "f":f, "b":"f+f+f--f--f+f+f"}
    snake_replacementRules = {"b": "b+f+b--f--b+f+b"}
    snake_start = "b--f--b--f"


            

Reported by Pylint.

Undefined variable 'reset'
Error

Line: 70 Column: 5

              
    drawing = replace(snake_start, snake_replacementRules, 3)

    reset()
    speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)

            

Reported by Pylint.

Undefined variable 'speed'
Error

Line: 71 Column: 5

                  drawing = replace(snake_start, snake_replacementRules, 3)

    reset()
    speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)
    down()

            

Reported by Pylint.

Undefined variable 'tracer'
Error

Line: 72 Column: 5

              
    reset()
    speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)

            

Reported by Pylint.

Undefined variable 'ht'
Error

Line: 73 Column: 5

                  reset()
    speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)


            

Reported by Pylint.

Undefined variable 'up'
Error

Line: 74 Column: 5

                  speed(3)
    tracer(1,0)
    ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)

    from time import sleep

            

Reported by Pylint.

Undefined variable 'backward'
Error

Line: 75 Column: 5

                  tracer(1,0)
    ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)

    from time import sleep
    sleep(3)

            

Reported by Pylint.

Undefined variable 'down'
Error

Line: 76 Column: 5

                  ht()
    up()
    backward(195)
    down()
    draw(drawing, snake_rules)

    from time import sleep
    sleep(3)


            

Reported by Pylint.