The following issues were found

Lib/test/test_mmap.py
180 issues
Unused variable 'tp'
Error

Line: 47 Column: 9

              
        # Simple sanity checks

        tp = str(type(m))  # SF bug 128713:  segfaulted on Linux
        self.assertEqual(m.find(b'foo'), PAGESIZE)

        self.assertEqual(len(m), 2*PAGESIZE)

        self.assertEqual(m[0], 0)

            

Reported by Pylint.

Unused variable 'length'
Error

Line: 76 Column: 13

                          self.fail('regex match on mmap failed!')
        else:
            start, end = match.span(0)
            length = end - start

            self.assertEqual(start, PAGESIZE)
            self.assertEqual(end, PAGESIZE + 6)

        # test seeking around (try to overflow the seek implementation)

            

Reported by Pylint.

Redefining built-in 'slice'
Error

Line: 266 Column: 17

              
        for start in range(n+1):
            for finish in range(start, n+1):
                slice = data[start : finish]
                self.assertEqual(m.find(slice), data.find(slice))
                self.assertEqual(m.find(slice + b'x'), -1)
        m.close()

    def test_find_end(self):

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 648 Column: 9

                      m = mmap.mmap(-1, 1000, tagname="foo")
        try:
            mmap.mmap(-1, 5000, tagname="foo")[:] # same tagname, but larger size
        except:
            pass
        m.close()

        # Should not crash (Issue 5385)
        with open(TESTFN, "wb") as fp:

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 660 Column: 9

                      f.close()
        try:
            m.resize(0) # will raise OSError
        except:
            pass
        try:
            m[:]
        except:
            pass

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 664 Column: 9

                          pass
        try:
            m[:]
        except:
            pass
        m.close()

    @unittest.skipUnless(os.name == 'nt', 'requires Windows')
    def test_invalid_descriptor(self):

            

Reported by Pylint.

Unused variable 'm'
Error

Line: 676 Column: 17

                      s = socket.socket()
        try:
            with self.assertRaises(OSError):
                m = mmap.mmap(s.fileno(), 10)
        finally:
            s.close()

    def test_context_manager(self):
        with mmap.mmap(-1, 10) as m:

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 727 Column: 13

                  def test_concat_repeat_exception(self):
        m = mmap.mmap(-1, 16)
        with self.assertRaises(TypeError):
            m + m
        with self.assertRaises(TypeError):
            m * 2

    def test_flush_return_value(self):
        # mm.flush() should return None on success, raise an

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 729 Column: 13

                      with self.assertRaises(TypeError):
            m + m
        with self.assertRaises(TypeError):
            m * 2

    def test_flush_return_value(self):
        # mm.flush() should return None on success, raise an
        # exception on error under all platforms.
        mm = mmap.mmap(-1, 16)

            

Reported by Pylint.

Consider explicitly re-raising using the 'from' keyword
Error

Line: 822 Column: 13

                              f.close()
            except (OSError, OverflowError):
                pass
            raise unittest.SkipTest("filesystem does not have largefile support")
        return f

    def test_large_offset(self):
        with self._make_test_file(0x14FFFFFFF, b" ") as f:
            with mmap.mmap(f.fileno(), 0, offset=0x140000000, access=mmap.ACCESS_READ) as m:

            

Reported by Pylint.

Lib/ctypes/test/test_arrays.py
180 issues
class already defined line 178
Error

Line: 181 Column: 13

                          class T(Array):
                pass
        with self.assertRaises(AttributeError):
            class T(Array):
                _type_ = c_int
        with self.assertRaises(AttributeError):
            class T(Array):
                _length_ = 13


            

Reported by Pylint.

class already defined line 178
Error

Line: 184 Column: 13

                          class T(Array):
                _type_ = c_int
        with self.assertRaises(AttributeError):
            class T(Array):
                _length_ = 13

    def test_bad_length(self):
        with self.assertRaises(ValueError):
            class T(Array):

            

Reported by Pylint.

class already defined line 189
Error

Line: 193 Column: 13

                              _type_ = c_int
                _length_ = - sys.maxsize * 2
        with self.assertRaises(ValueError):
            class T(Array):
                _type_ = c_int
                _length_ = -1
        with self.assertRaises(TypeError):
            class T(Array):
                _type_ = c_int

            

Reported by Pylint.

class already defined line 189
Error

Line: 197 Column: 13

                              _type_ = c_int
                _length_ = -1
        with self.assertRaises(TypeError):
            class T(Array):
                _type_ = c_int
                _length_ = 1.87
        with self.assertRaises(OverflowError):
            class T(Array):
                _type_ = c_int

            

Reported by Pylint.

class already defined line 189
Error

Line: 201 Column: 13

                              _type_ = c_int
                _length_ = 1.87
        with self.assertRaises(OverflowError):
            class T(Array):
                _type_ = c_int
                _length_ = sys.maxsize * 2

    def test_zero_length(self):
        # _length_ can be zero.

            

Reported by Pylint.

Unused import pydll from wildcard import
Error

Line: 4 Column: 1

              import unittest
from test.support import bigmemtest, _2G
import sys
from ctypes import *

from ctypes.test import need_symbol

formats = "bBhHiIlLqQfd"


            

Reported by Pylint.

Wildcard import ctypes
Error

Line: 4 Column: 1

              import unittest
from test.support import bigmemtest, _2G
import sys
from ctypes import *

from ctypes.test import need_symbol

formats = "bBhHiIlLqQfd"


            

Reported by Pylint.

Unused import windll from wildcard import
Error

Line: 4 Column: 1

              import unittest
from test.support import bigmemtest, _2G
import sys
from ctypes import *

from ctypes.test import need_symbol

formats = "bBhHiIlLqQfd"


            

Reported by Pylint.

Unused import c_size_t from wildcard import
Error

Line: 4 Column: 1

              import unittest
from test.support import bigmemtest, _2G
import sys
from ctypes import *

from ctypes.test import need_symbol

formats = "bBhHiIlLqQfd"


            

Reported by Pylint.

Unused import oledll from wildcard import
Error

Line: 4 Column: 1

              import unittest
from test.support import bigmemtest, _2G
import sys
from ctypes import *

from ctypes.test import need_symbol

formats = "bBhHiIlLqQfd"


            

Reported by Pylint.

Tools/demo/sortvisu.py
180 issues
Unable to import 'tkinter'
Error

Line: 21 Column: 1

              stand-alone application.
"""

from tkinter import *
import random

XGRID = 10
YGRID = 10
WIDTH = 6

            

Reported by Pylint.

Undefined variable 'Frame'
Error

Line: 36 Column: 22

              
    def __init__(self, master, data=None):
        self.master = master
        self.frame = Frame(self.master)
        self.frame.pack(fill=X)
        self.label = Label(self.frame)
        self.label.pack()
        self.canvas = Canvas(self.frame)
        self.canvas.pack()

            

Reported by Pylint.

Undefined variable 'X'
Error

Line: 37 Column: 30

                  def __init__(self, master, data=None):
        self.master = master
        self.frame = Frame(self.master)
        self.frame.pack(fill=X)
        self.label = Label(self.frame)
        self.label.pack()
        self.canvas = Canvas(self.frame)
        self.canvas.pack()
        self.report = Label(self.frame)

            

Reported by Pylint.

Undefined variable 'Label'
Error

Line: 38 Column: 22

                      self.master = master
        self.frame = Frame(self.master)
        self.frame.pack(fill=X)
        self.label = Label(self.frame)
        self.label.pack()
        self.canvas = Canvas(self.frame)
        self.canvas.pack()
        self.report = Label(self.frame)
        self.report.pack()

            

Reported by Pylint.

Undefined variable 'Canvas'
Error

Line: 40 Column: 23

                      self.frame.pack(fill=X)
        self.label = Label(self.frame)
        self.label.pack()
        self.canvas = Canvas(self.frame)
        self.canvas.pack()
        self.report = Label(self.frame)
        self.report.pack()
        self.left = self.canvas.create_line(0, 0, 0, 0)
        self.right = self.canvas.create_line(0, 0, 0, 0)

            

Reported by Pylint.

Undefined variable 'Label'
Error

Line: 42 Column: 23

                      self.label.pack()
        self.canvas = Canvas(self.frame)
        self.canvas.pack()
        self.report = Label(self.frame)
        self.report.pack()
        self.left = self.canvas.create_line(0, 0, 0, 0)
        self.right = self.canvas.create_line(0, 0, 0, 0)
        self.pivot = self.canvas.create_line(0, 0, 0, 0)
        self.items = []

            

Reported by Pylint.

Undefined variable 'Frame'
Error

Line: 492 Column: 25

                      self.busy = 0
        self.array = Array(self.master)

        self.botframe = Frame(master)
        self.botframe.pack(side=BOTTOM)
        self.botleftframe = Frame(self.botframe)
        self.botleftframe.pack(side=LEFT, fill=Y)
        self.botrightframe = Frame(self.botframe)
        self.botrightframe.pack(side=RIGHT, fill=Y)

            

Reported by Pylint.

Undefined variable 'BOTTOM'
Error

Line: 493 Column: 33

                      self.array = Array(self.master)

        self.botframe = Frame(master)
        self.botframe.pack(side=BOTTOM)
        self.botleftframe = Frame(self.botframe)
        self.botleftframe.pack(side=LEFT, fill=Y)
        self.botrightframe = Frame(self.botframe)
        self.botrightframe.pack(side=RIGHT, fill=Y)


            

Reported by Pylint.

Undefined variable 'Frame'
Error

Line: 494 Column: 29

              
        self.botframe = Frame(master)
        self.botframe.pack(side=BOTTOM)
        self.botleftframe = Frame(self.botframe)
        self.botleftframe.pack(side=LEFT, fill=Y)
        self.botrightframe = Frame(self.botframe)
        self.botrightframe.pack(side=RIGHT, fill=Y)

        self.b_qsort = Button(self.botleftframe,

            

Reported by Pylint.

Undefined variable 'LEFT'
Error

Line: 495 Column: 37

                      self.botframe = Frame(master)
        self.botframe.pack(side=BOTTOM)
        self.botleftframe = Frame(self.botframe)
        self.botleftframe.pack(side=LEFT, fill=Y)
        self.botrightframe = Frame(self.botframe)
        self.botrightframe.pack(side=RIGHT, fill=Y)

        self.b_qsort = Button(self.botleftframe,
                              text="Quicksort", command=self.c_qsort)

            

Reported by Pylint.

Lib/unittest/test/test_result.py
179 issues
Cannot import 'traceback' due to syntax error 'invalid syntax (<unknown>, line 576)'
Error

Line: 7 Column: 1

              
from test.support import warnings_helper

import traceback
import unittest


class MockTraceback(object):
    class TracebackException:

            

Reported by Pylint.

Instance of 'OldResult' has no 'failures' member
Error

Line: 465 Column: 34

                              ("TestResult has no add.+ method,", RuntimeWarning)):
            result = OldResult()
            test.run(result)
            self.assertEqual(len(result.failures), failures)

    def testOldTestResult(self):
        class Test(unittest.TestCase):
            def testSkip(self):
                self.skipTest('foobar')

            

Reported by Pylint.

Unused argument 'args'
Error

Line: 13 Column: 1

              
class MockTraceback(object):
    class TracebackException:
        def __init__(self, *args, **kwargs):
            self.capture_locals = kwargs.get('capture_locals', False)
        def format(self):
            result = ['A traceback']
            if self.capture_locals:
                result.append('locals')

            

Reported by Pylint.

Access to a protected member _stdout_buffer of a client class
Error

Line: 43 Column: 27

                      self.assertEqual(len(result.failures), 0)
        self.assertEqual(result.testsRun, 0)
        self.assertEqual(result.shouldStop, False)
        self.assertIsNone(result._stdout_buffer)
        self.assertIsNone(result._stderr_buffer)

    # "This method can be called to signal that the set of tests being
    # run should be aborted by setting the TestResult's shouldStop
    # attribute to True."

            

Reported by Pylint.

Access to a protected member _stderr_buffer of a client class
Error

Line: 44 Column: 27

                      self.assertEqual(result.testsRun, 0)
        self.assertEqual(result.shouldStop, False)
        self.assertIsNone(result._stdout_buffer)
        self.assertIsNone(result._stderr_buffer)

    # "This method can be called to signal that the set of tests being
    # run should be aborted by setting the TestResult's shouldStop
    # attribute to True."
    def test_stop(self):

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 177 Column: 9

                      test = Foo('test_1')
        try:
            test.fail("foo")
        except:
            exc_info_tuple = sys.exc_info()

        result = unittest.TestResult()

        result.startTest(test)

            

Reported by Pylint.

No exception type(s) specified
Error

Line: 225 Column: 9

                      test = Foo('test_1')
        try:
            raise TypeError()
        except:
            exc_info_tuple = sys.exc_info()

        result = unittest.TestResult()

        result.startTest(test)

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 247 Column: 17

                  def test_addError_locals(self):
        class Foo(unittest.TestCase):
            def test_1(self):
                1/0

        test = Foo('test_1')
        result = unittest.TestResult()
        result.tb_locals = True


            

Reported by Pylint.

Unused variable 'test_case'
Error

Line: 260 Column: 9

                      result.stopTestRun()

        self.assertEqual(len(result.errors), 1)
        test_case, formatted_exc = result.errors[0]
        self.assertEqual('A tracebacklocals', formatted_exc)

    def test_addSubTest(self):
        class Foo(unittest.TestCase):
            def test_1(self):

            

Reported by Pylint.

Access to a protected member _is_relevant_tb_level of a client class
Error

Line: 411 Column: 26

                          class tb_frame(object):
                f_globals = {}
        result = unittest.TestResult()
        self.assertFalse(result._is_relevant_tb_level(Frame))

        Frame.tb_frame.f_globals['__unittest'] = True
        self.assertTrue(result._is_relevant_tb_level(Frame))

    def testFailFast(self):

            

Reported by Pylint.

Lib/asyncio/windows_events.py
179 issues
Unable to import '_overlapped'
Error

Line: 3 Column: 1

              """Selector and proactor event loops for Windows."""

import _overlapped
import _winapi
import errno
import math
import msvcrt
import socket
import struct

            

Reported by Pylint.

Unable to import '_winapi'
Error

Line: 4 Column: 1

              """Selector and proactor event loops for Windows."""

import _overlapped
import _winapi
import errno
import math
import msvcrt
import socket
import struct

            

Reported by Pylint.

Unable to import 'msvcrt'
Error

Line: 7 Column: 1

              import _winapi
import errno
import math
import msvcrt
import socket
import struct
import time
import weakref


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              import time
import weakref

from . import events
from . import base_subprocess
from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              import weakref

from . import events
from . import base_subprocess
from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              
from . import events
from . import base_subprocess
from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              from . import events
from . import base_subprocess
from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
from .log import logger

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 17 Column: 1

              from . import base_subprocess
from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
from .log import logger


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 18 Column: 1

              from . import futures
from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
from .log import logger



            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 19 Column: 1

              from . import exceptions
from . import proactor_events
from . import selector_events
from . import tasks
from . import windows_utils
from .log import logger


__all__ = (

            

Reported by Pylint.

Lib/turtledemo/__main__.py
179 issues
Instance of 'ScrolledCanvas' has no 'xview_moveto' member
Error

Line: 208 Column: 9

                  def onResize(self, event):
        cwidth = self._canvas.winfo_width()
        cheight = self._canvas.winfo_height()
        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)

    def makeTextFrame(self, root):
        self.text_frame = text_frame = Frame(root)
        self.text = text = Text(text_frame, name='text', padx=5,

            

Reported by Pylint.

Instance of 'ScrolledCanvas' has no 'yview_moveto' member
Error

Line: 209 Column: 9

                      cwidth = self._canvas.winfo_width()
        cheight = self._canvas.winfo_height()
        self._canvas.xview_moveto(0.5*(self.canvwidth-cwidth)/self.canvwidth)
        self._canvas.yview_moveto(0.5*(self.canvheight-cheight)/self.canvheight)

    def makeTextFrame(self, root):
        self.text_frame = text_frame = Frame(root)
        self.text = text = Text(text_frame, name='text', padx=5,
                                wrap='none', width=45)

            

Reported by Pylint.

Unused import N from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Unused import BASELINE from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Unused import ON from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Unused import NW from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Unused import E from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Wildcard import tkinter
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Unused import W from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Unused import S from wildcard import
Error

Line: 91 Column: 1

              import sys
import os

from tkinter import *
from idlelib.colorizer import ColorDelegator, color_config
from idlelib.percolator import Percolator
from idlelib.textview import view_text
from turtledemo import __doc__ as about_turtledemo


            

Reported by Pylint.

Lib/pathlib.py
179 issues
Instance of '_Flavour' has no 'sep' member
Error

Line: 54 Column: 21

                  semantics."""

    def __init__(self):
        self.join = self.sep.join

    def parse_parts(self, parts):
        parsed = []
        sep = self.sep
        altsep = self.altsep

            

Reported by Pylint.

Instance of '_Flavour' has no 'sep' member
Error

Line: 58 Column: 15

              
    def parse_parts(self, parts):
        parsed = []
        sep = self.sep
        altsep = self.altsep
        drv = root = ''
        it = reversed(parts)
        for part in it:
            if not part:

            

Reported by Pylint.

Instance of '_Flavour' has no 'altsep' member
Error

Line: 59 Column: 18

                  def parse_parts(self, parts):
        parsed = []
        sep = self.sep
        altsep = self.altsep
        drv = root = ''
        it = reversed(parts)
        for part in it:
            if not part:
                continue

            

Reported by Pylint.

Instance of '_Flavour' has no 'splitroot' member
Error

Line: 67 Column: 30

                              continue
            if altsep:
                part = part.replace(altsep, sep)
            drv, root, rel = self.splitroot(part)
            if sep in rel:
                for x in reversed(rel.split(sep)):
                    if x and x != '.':
                        parsed.append(sys.intern(x))
            else:

            

Reported by Pylint.

Instance of '_Flavour' has no 'splitroot' member
Error

Line: 85 Column: 31

                                          continue
                        if altsep:
                            part = part.replace(altsep, sep)
                        drv = self.splitroot(part)[0]
                        if drv:
                            break
                break
        if drv or root:
            parsed.append(drv + root)

            

Reported by Pylint.

Instance of '_Flavour' has no 'casefold' member
Error

Line: 103 Column: 54

                          if not drv2 and drv:
                return drv, root2, [drv + root2] + parts2[1:]
        elif drv2:
            if drv2 == drv or self.casefold(drv2) == self.casefold(drv):
                # Same drive => second path is relative to the first
                return drv, root, parts + parts2[1:]
        else:
            # Second path is non-anchored (common case)
            return drv, root, parts + parts2

            

Reported by Pylint.

Instance of '_Flavour' has no 'casefold' member
Error

Line: 103 Column: 31

                          if not drv2 and drv:
                return drv, root2, [drv + root2] + parts2[1:]
        elif drv2:
            if drv2 == drv or self.casefold(drv2) == self.casefold(drv):
                # Same drive => second path is relative to the first
                return drv, root, parts + parts2[1:]
        else:
            # Second path is non-anchored (common case)
            return drv, root, parts + parts2

            

Reported by Pylint.

Instance of '_Selector' has no '_select_from' member; maybe 'select_from'?
Error

Line: 407 Column: 16

                      scandir = parent_path._accessor.scandir
        if not is_dir(parent_path):
            return iter([])
        return self._select_from(parent_path, is_dir, exists, scandir)


class _TerminatingSelector:

    def _select_from(self, parent_path, is_dir, exists, scandir):

            

Reported by Pylint.

Class 'PurePath' has no '_flavour' member
Error

Line: 585 Column: 16

                                      "argument should be a str object or an os.PathLike "
                        "object returning str, not %r"
                        % type(a))
        return cls._flavour.parse_parts(parts)

    @classmethod
    def _from_parts(cls, args):
        # We need to call _parse_args on the instance, so as to get the
        # right flavour.

            

Reported by Pylint.

Class 'PurePath' has no '_flavour' member
Error

Line: 609 Column: 33

                  @classmethod
    def _format_parsed_parts(cls, drv, root, parts):
        if drv or root:
            return drv + root + cls._flavour.join(parts[1:])
        else:
            return cls._flavour.join(parts)

    def _make_child(self, args):
        drv, root, parts = self._parse_args(args)

            

Reported by Pylint.

Lib/aifc.py
178 issues
Instance of 'Aifc_read' has no 'setparams' member; maybe 'getparams'?
Error

Line: 956 Column: 17

                          gn = sys.argv[2]
            print("Writing", gn)
            with open(gn, 'w') as g:
                g.setparams(f.getparams())
                while 1:
                    data = f.readframes(1024)
                    if not data:
                        break
                    g.writeframes(data)

            

Reported by Pylint.

Instance of 'Aifc_read' has no 'writeframes' member
Error

Line: 961 Column: 21

                                  data = f.readframes(1024)
                    if not data:
                        break
                    g.writeframes(data)
            print("Done.")

            

Reported by Pylint.

Redefining name 'data' from outer scope (line 958)
Error

Line: 175 Column: 9

              def _read_string(file):
    length = ord(file.read(1))
    if length == 0:
        data = b''
    else:
        data = file.read(length)
    if length & 1 == 0:
        dummy = file.read(1)
    return data

            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 184 Column: 17

              
_HUGE_VAL = 1.79769313486231e+308 # See <limits.h>

def _read_float(f): # 10 bytes
    expon = _read_short(f) # 2 bytes
    sign = 1
    if expon < 0:
        sign = -1
        expon = expon + 0x8000

            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 201 Column: 18

                      f = (himant * 0x100000000 + lomant) * pow(2.0, expon - 63)
    return sign * f

def _write_short(f, x):
    f.write(struct.pack('>h', x))

def _write_ushort(f, x):
    f.write(struct.pack('>H', x))


            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 204 Column: 19

              def _write_short(f, x):
    f.write(struct.pack('>h', x))

def _write_ushort(f, x):
    f.write(struct.pack('>H', x))

def _write_long(f, x):
    f.write(struct.pack('>l', x))


            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 207 Column: 17

              def _write_ushort(f, x):
    f.write(struct.pack('>H', x))

def _write_long(f, x):
    f.write(struct.pack('>l', x))

def _write_ulong(f, x):
    f.write(struct.pack('>L', x))


            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 210 Column: 18

              def _write_long(f, x):
    f.write(struct.pack('>l', x))

def _write_ulong(f, x):
    f.write(struct.pack('>L', x))

def _write_string(f, s):
    if len(s) > 255:
        raise ValueError("string exceeds maximum pstring length")

            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 213 Column: 19

              def _write_ulong(f, x):
    f.write(struct.pack('>L', x))

def _write_string(f, s):
    if len(s) > 255:
        raise ValueError("string exceeds maximum pstring length")
    f.write(struct.pack('B', len(s)))
    f.write(s)
    if len(s) & 1 == 0:

            

Reported by Pylint.

Redefining name 'f' from outer scope (line 944)
Error

Line: 221 Column: 18

                  if len(s) & 1 == 0:
        f.write(b'\x00')

def _write_float(f, x):
    import math
    if x < 0:
        sign = 0x8000
        x = x * -1
    else:

            

Reported by Pylint.

Lib/test/test_isinstance.py
178 issues
unsupported operand type(s) for |
Error

Line: 213 Column: 45

                      self.assertEqual(False, isinstance(AbstractChild(), Child))

    def test_isinstance_with_or_union(self):
        self.assertTrue(isinstance(Super(), Super | int))
        self.assertFalse(isinstance(None, str | int))
        self.assertTrue(isinstance(3, str | int))
        self.assertTrue(isinstance("", str | int))
        self.assertTrue(isinstance([], typing.List | typing.Tuple))
        self.assertTrue(isinstance(2, typing.List | int))

            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 214 Column: 43

              
    def test_isinstance_with_or_union(self):
        self.assertTrue(isinstance(Super(), Super | int))
        self.assertFalse(isinstance(None, str | int))
        self.assertTrue(isinstance(3, str | int))
        self.assertTrue(isinstance("", str | int))
        self.assertTrue(isinstance([], typing.List | typing.Tuple))
        self.assertTrue(isinstance(2, typing.List | int))
        self.assertFalse(isinstance(2, typing.List | typing.Tuple))

            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 215 Column: 39

                  def test_isinstance_with_or_union(self):
        self.assertTrue(isinstance(Super(), Super | int))
        self.assertFalse(isinstance(None, str | int))
        self.assertTrue(isinstance(3, str | int))
        self.assertTrue(isinstance("", str | int))
        self.assertTrue(isinstance([], typing.List | typing.Tuple))
        self.assertTrue(isinstance(2, typing.List | int))
        self.assertFalse(isinstance(2, typing.List | typing.Tuple))
        self.assertTrue(isinstance(None, int | None))

            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 216 Column: 40

                      self.assertTrue(isinstance(Super(), Super | int))
        self.assertFalse(isinstance(None, str | int))
        self.assertTrue(isinstance(3, str | int))
        self.assertTrue(isinstance("", str | int))
        self.assertTrue(isinstance([], typing.List | typing.Tuple))
        self.assertTrue(isinstance(2, typing.List | int))
        self.assertFalse(isinstance(2, typing.List | typing.Tuple))
        self.assertTrue(isinstance(None, int | None))
        self.assertFalse(isinstance(3.14, int | str))

            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 218 Column: 39

                      self.assertTrue(isinstance(3, str | int))
        self.assertTrue(isinstance("", str | int))
        self.assertTrue(isinstance([], typing.List | typing.Tuple))
        self.assertTrue(isinstance(2, typing.List | int))
        self.assertFalse(isinstance(2, typing.List | typing.Tuple))
        self.assertTrue(isinstance(None, int | None))
        self.assertFalse(isinstance(3.14, int | str))
        with self.assertRaises(TypeError):
            isinstance(2, list[int])

            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 220 Column: 42

                      self.assertTrue(isinstance([], typing.List | typing.Tuple))
        self.assertTrue(isinstance(2, typing.List | int))
        self.assertFalse(isinstance(2, typing.List | typing.Tuple))
        self.assertTrue(isinstance(None, int | None))
        self.assertFalse(isinstance(3.14, int | str))
        with self.assertRaises(TypeError):
            isinstance(2, list[int])
        with self.assertRaises(TypeError):
            isinstance(2, list[int] | int)

            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 221 Column: 43

                      self.assertTrue(isinstance(2, typing.List | int))
        self.assertFalse(isinstance(2, typing.List | typing.Tuple))
        self.assertTrue(isinstance(None, int | None))
        self.assertFalse(isinstance(3.14, int | str))
        with self.assertRaises(TypeError):
            isinstance(2, list[int])
        with self.assertRaises(TypeError):
            isinstance(2, list[int] | int)
        with self.assertRaises(TypeError):

            

Reported by Pylint.

Value 'list' is unsubscriptable
Error

Line: 223 Column: 27

                      self.assertTrue(isinstance(None, int | None))
        self.assertFalse(isinstance(3.14, int | str))
        with self.assertRaises(TypeError):
            isinstance(2, list[int])
        with self.assertRaises(TypeError):
            isinstance(2, list[int] | int)
        with self.assertRaises(TypeError):
            isinstance(2, int | str | list[int] | float)


            

Reported by Pylint.

Value 'list' is unsubscriptable
Error

Line: 225 Column: 27

                      with self.assertRaises(TypeError):
            isinstance(2, list[int])
        with self.assertRaises(TypeError):
            isinstance(2, list[int] | int)
        with self.assertRaises(TypeError):
            isinstance(2, int | str | list[int] | float)




            

Reported by Pylint.

unsupported operand type(s) for |
Error

Line: 225 Column: 27

                      with self.assertRaises(TypeError):
            isinstance(2, list[int])
        with self.assertRaises(TypeError):
            isinstance(2, list[int] | int)
        with self.assertRaises(TypeError):
            isinstance(2, int | str | list[int] | float)




            

Reported by Pylint.

Lib/tkinter/simpledialog.py
175 issues
Assigning result of a function call, where the function has no return
Error

Line: 128 Column: 9

                      self.result = None

        body = Frame(self)
        self.initial_focus = self.body(body)
        body.pack(padx=5, pady=5)

        self.buttonbox()

        if self.initial_focus is None:

            

Reported by Pylint.

Instance of '_QueryDialog' has no 'getresult' member
Error

Line: 305 Column: 22

              
    def validate(self):
        try:
            result = self.getresult()
        except ValueError:
            messagebox.showwarning(
                "Illegal value",
                self.errormessage + "\nPlease try again",
                parent = self

            

Reported by Pylint.

Instance of '_QueryDialog' has no 'errormessage' member
Error

Line: 309 Column: 17

                      except ValueError:
            messagebox.showwarning(
                "Illegal value",
                self.errormessage + "\nPlease try again",
                parent = self
            )
            return 0

        if self.minvalue is not None and result < self.minvalue:

            

Reported by Pylint.

Unused import READABLE from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.

Unused import SINGLE from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.

Unused import BROWSE from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.

Unused import MULTIPLE from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.

Unused import EXTENDED from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.

Unused import FALSE from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.

Unused import NO from wildcard import
Error

Line: 26 Column: 1

              askstring -- get a string from the user
"""

from tkinter import *
from tkinter import _get_temp_root, _destroy_temp_root
from tkinter import messagebox


class SimpleDialog:

            

Reported by Pylint.