The following issues were found

Lib/test/test_index.py
162 issues
Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 105 Column: 44

                  def test_index(self):
        self.o.ind = -2
        self.n.ind = 2
        self.assertEqual(self.seq[self.n], self.seq[2])
        self.assertEqual(self.seq[self.o], self.seq[-2])

    def test_slice(self):
        self.o.ind = 1
        self.o2.ind = 3

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 105 Column: 26

                  def test_index(self):
        self.o.ind = -2
        self.n.ind = 2
        self.assertEqual(self.seq[self.n], self.seq[2])
        self.assertEqual(self.seq[self.o], self.seq[-2])

    def test_slice(self):
        self.o.ind = 1
        self.o2.ind = 3

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'assertEqual' member
Error

Line: 105 Column: 9

                  def test_index(self):
        self.o.ind = -2
        self.n.ind = 2
        self.assertEqual(self.seq[self.n], self.seq[2])
        self.assertEqual(self.seq[self.o], self.seq[-2])

    def test_slice(self):
        self.o.ind = 1
        self.o2.ind = 3

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 106 Column: 26

                      self.o.ind = -2
        self.n.ind = 2
        self.assertEqual(self.seq[self.n], self.seq[2])
        self.assertEqual(self.seq[self.o], self.seq[-2])

    def test_slice(self):
        self.o.ind = 1
        self.o2.ind = 3
        self.n.ind = 2

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 106 Column: 44

                      self.o.ind = -2
        self.n.ind = 2
        self.assertEqual(self.seq[self.n], self.seq[2])
        self.assertEqual(self.seq[self.o], self.seq[-2])

    def test_slice(self):
        self.o.ind = 1
        self.o2.ind = 3
        self.n.ind = 2

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'assertEqual' member
Error

Line: 106 Column: 9

                      self.o.ind = -2
        self.n.ind = 2
        self.assertEqual(self.seq[self.n], self.seq[2])
        self.assertEqual(self.seq[self.o], self.seq[-2])

    def test_slice(self):
        self.o.ind = 1
        self.o2.ind = 3
        self.n.ind = 2

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'assertEqual' member
Error

Line: 113 Column: 9

                      self.o2.ind = 3
        self.n.ind = 2
        self.n2.ind = 4
        self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
        self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])

    def test_slice_bug7532(self):
        seqlen = len(self.seq)
        self.o.ind = int(seqlen * 1.5)

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 113 Column: 52

                      self.o2.ind = 3
        self.n.ind = 2
        self.n2.ind = 4
        self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
        self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])

    def test_slice_bug7532(self):
        seqlen = len(self.seq)
        self.o.ind = int(seqlen * 1.5)

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 113 Column: 26

                      self.o2.ind = 3
        self.n.ind = 2
        self.n2.ind = 4
        self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
        self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])

    def test_slice_bug7532(self):
        seqlen = len(self.seq)
        self.o.ind = int(seqlen * 1.5)

            

Reported by Pylint.

Instance of 'SeqTestCase' has no 'seq' member
Error

Line: 114 Column: 26

                      self.n.ind = 2
        self.n2.ind = 4
        self.assertEqual(self.seq[self.o:self.o2], self.seq[1:3])
        self.assertEqual(self.seq[self.n:self.n2], self.seq[2:4])

    def test_slice_bug7532(self):
        seqlen = len(self.seq)
        self.o.ind = int(seqlen * 1.5)
        self.n.ind = seqlen + 2

            

Reported by Pylint.

Lib/multiprocessing/connection.py
162 issues
Attempted relative import beyond top-level package
Error

Line: 23 Column: 1

              
import _multiprocessing

from . import util

from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 25 Column: 1

              
from . import util

from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler

try:
    import _winapi

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 26 Column: 1

              from . import util

from . import AuthenticationError, BufferTooShort
from .context import reduction
_ForkingPickler = reduction.ForkingPickler

try:
    import _winapi
    from _winapi import WAIT_OBJECT_0, WAIT_ABANDONED_0, WAIT_TIMEOUT, INFINITE

            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_close' member; maybe 'close'?
Error

Line: 137 Column: 13

              
    def __del__(self):
        if self._handle is not None:
            self._close()

    def _check_closed(self):
        if self._handle is None:
            raise OSError("handle is closed")


            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_close' member; maybe 'close'?
Error

Line: 182 Column: 17

                      """Close the connection"""
        if self._handle is not None:
            try:
                self._close()
            finally:
                self._handle = None

    def send_bytes(self, buf, offset=0, size=None):
        """Send the bytes data from a bytes-like object"""

            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_send_bytes' member; maybe 'send_bytes'?
Error

Line: 205 Column: 9

                          raise ValueError("size is negative")
        elif offset + size > n:
            raise ValueError("buffer length < offset + size")
        self._send_bytes(m[offset:offset + size])

    def send(self, obj):
        """Send a (picklable) object"""
        self._check_closed()
        self._check_writable()

            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_send_bytes' member; maybe 'send_bytes'?
Error

Line: 211 Column: 9

                      """Send a (picklable) object"""
        self._check_closed()
        self._check_writable()
        self._send_bytes(_ForkingPickler.dumps(obj))

    def recv_bytes(self, maxlength=None):
        """
        Receive bytes data as a bytes object.
        """

            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_recv_bytes' member; maybe 'recv_bytes'?
Error

Line: 221 Column: 15

                      self._check_readable()
        if maxlength is not None and maxlength < 0:
            raise ValueError("negative maxlength")
        buf = self._recv_bytes(maxlength)
        if buf is None:
            self._bad_message_length()
        return buf.getvalue()

    def recv_bytes_into(self, buf, offset=0):

            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_recv_bytes' member; maybe 'recv_bytes'?
Error

Line: 241 Column: 22

                              raise ValueError("negative offset")
            elif offset > bytesize:
                raise ValueError("offset too large")
            result = self._recv_bytes()
            size = result.tell()
            if bytesize < offset + size:
                raise BufferTooShort(result.getvalue())
            # Message can fit in dest
            result.seek(0)

            

Reported by Pylint.

Instance of '_ConnectionBase' has no '_recv_bytes' member; maybe 'recv_bytes'?
Error

Line: 255 Column: 15

                      """Receive a (picklable) object"""
        self._check_closed()
        self._check_readable()
        buf = self._recv_bytes()
        return _ForkingPickler.loads(buf.getbuffer())

    def poll(self, timeout=0.0):
        """Whether there is any input available to be read"""
        self._check_closed()

            

Reported by Pylint.

Lib/test/test_signal.py
161 issues
Module 'signal' has no 'Handlers' member
Error

Line: 28 Column: 44

                      for name in dir(signal):
            sig = getattr(signal, name)
            if name in {'SIG_DFL', 'SIG_IGN'}:
                self.assertIsInstance(sig, signal.Handlers)
            elif name in {'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'}:
                self.assertIsInstance(sig, signal.Sigmasks)
            elif name.startswith('SIG') and not name.startswith('SIG_'):
                self.assertIsInstance(sig, signal.Signals)
            elif name.startswith('CTRL_'):

            

Reported by Pylint.

Module 'signal' has no 'Sigmasks' member
Error

Line: 30 Column: 44

                          if name in {'SIG_DFL', 'SIG_IGN'}:
                self.assertIsInstance(sig, signal.Handlers)
            elif name in {'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'}:
                self.assertIsInstance(sig, signal.Sigmasks)
            elif name.startswith('SIG') and not name.startswith('SIG_'):
                self.assertIsInstance(sig, signal.Signals)
            elif name.startswith('CTRL_'):
                self.assertIsInstance(sig, signal.Signals)
                self.assertEqual(sys.platform, "win32")

            

Reported by Pylint.

Module 'signal' has no 'Signals' member
Error

Line: 32 Column: 44

                          elif name in {'SIG_BLOCK', 'SIG_UNBLOCK', 'SIG_SETMASK'}:
                self.assertIsInstance(sig, signal.Sigmasks)
            elif name.startswith('SIG') and not name.startswith('SIG_'):
                self.assertIsInstance(sig, signal.Signals)
            elif name.startswith('CTRL_'):
                self.assertIsInstance(sig, signal.Signals)
                self.assertEqual(sys.platform, "win32")

        CheckedSignals = enum._old_convert_(

            

Reported by Pylint.

Module 'signal' has no 'Signals' member
Error

Line: 34 Column: 44

                          elif name.startswith('SIG') and not name.startswith('SIG_'):
                self.assertIsInstance(sig, signal.Signals)
            elif name.startswith('CTRL_'):
                self.assertIsInstance(sig, signal.Signals)
                self.assertEqual(sys.platform, "win32")

        CheckedSignals = enum._old_convert_(
                enum.IntEnum, 'Signals', 'signal',
                lambda name:

            

Reported by Pylint.

Module 'signal' has no 'Signals' member
Error

Line: 45 Column: 48

                                  or name.startswith('CTRL_'),
                source=signal,
                )
        enum._test_simple_enum(CheckedSignals, signal.Signals)

        CheckedHandlers = enum._old_convert_(
                enum.IntEnum, 'Handlers', 'signal',
                lambda name: name in ('SIG_DFL', 'SIG_IGN'),
                source=signal,

            

Reported by Pylint.

Module 'signal' has no 'Handlers' member
Error

Line: 52 Column: 49

                              lambda name: name in ('SIG_DFL', 'SIG_IGN'),
                source=signal,
                )
        enum._test_simple_enum(CheckedHandlers, signal.Handlers)

        Sigmasks = getattr(signal, 'Sigmasks', None)
        if Sigmasks is not None:
            CheckedSigmasks = enum._old_convert_(
                    enum.IntEnum, 'Sigmasks', 'signal',

            

Reported by Pylint.

Module 'signal' has no 'Handlers' member
Error

Line: 83 Column: 36

              
    def test_getsignal(self):
        hup = signal.signal(signal.SIGHUP, self.trivial_signal_handler)
        self.assertIsInstance(hup, signal.Handlers)
        self.assertEqual(signal.getsignal(signal.SIGHUP),
                         self.trivial_signal_handler)
        signal.signal(signal.SIGHUP, hup)
        self.assertEqual(signal.getsignal(signal.SIGHUP), hup)


            

Reported by Pylint.

Module 'signal' has no 'Signals' member
Error

Line: 103 Column: 23

                  def test_valid_signals(self):
        s = signal.valid_signals()
        self.assertIsInstance(s, set)
        self.assertIn(signal.Signals.SIGINT, s)
        self.assertIn(signal.Signals.SIGALRM, s)
        self.assertNotIn(0, s)
        self.assertNotIn(signal.NSIG, s)
        self.assertLess(len(s), signal.NSIG)


            

Reported by Pylint.

Module 'signal' has no 'Signals' member
Error

Line: 104 Column: 23

                      s = signal.valid_signals()
        self.assertIsInstance(s, set)
        self.assertIn(signal.Signals.SIGINT, s)
        self.assertIn(signal.Signals.SIGALRM, s)
        self.assertNotIn(0, s)
        self.assertNotIn(signal.NSIG, s)
        self.assertLess(len(s), signal.NSIG)

    @unittest.skipUnless(sys.executable, "sys.executable required.")

            

Reported by Pylint.

Module 'signal' has no 'Signals' member
Error

Line: 133 Column: 23

                      s = signal.valid_signals()
        self.assertIsInstance(s, set)
        self.assertGreaterEqual(len(s), 6)
        self.assertIn(signal.Signals.SIGINT, s)
        self.assertNotIn(0, s)
        self.assertNotIn(signal.NSIG, s)
        self.assertLess(len(s), signal.NSIG)

    def test_issue9324(self):

            

Reported by Pylint.

Lib/test/test_peepholer.py
161 issues
function already defined line 81
Error

Line: 97 Column: 9

                          self.assertInBytecode(func, 'LOAD_CONST', elem)
            self.check_lnotab(func)

        def f():
            'Adding a docstring made this test fail in Py2.5.0'
            return None

        self.assertNotInBytecode(f, 'LOAD_GLOBAL')
        self.assertInBytecode(f, 'LOAD_CONST', None)

            

Reported by Pylint.

bad operand type for unary ~: list
Error

Line: 155 Column: 14

                      # . . . opcode_with_arg 100   unary_opcode   BUILD_TUPLE 1  . . .
        # The following would segfault upon compilation
        def crater():
            (~[
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
                0, 1, 2, 3, 4, 5, 6, 7, 8, 9,

            

Reported by Pylint.

Undefined variable 'a'
Error

Line: 339 Column: 16

                  def test_elim_jump_to_uncond_jump(self):
        # POP_JUMP_IF_FALSE to JUMP_FORWARD --> POP_JUMP_IF_FALSE to non-jump
        def f():
            if a:
                # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    foo()
            else:

            

Reported by Pylint.

Undefined variable 'c'
Error

Line: 341 Column: 21

                      def f():
            if a:
                # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    foo()
            else:
                baz()
        self.check_jump_targets(f)

            

Reported by Pylint.

Undefined variable 'd'
Error

Line: 342 Column: 24

                          if a:
                # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    foo()
            else:
                baz()
        self.check_jump_targets(f)
        self.check_lnotab(f)

            

Reported by Pylint.

Undefined variable 'foo'
Error

Line: 343 Column: 21

                              # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    foo()
            else:
                baz()
        self.check_jump_targets(f)
        self.check_lnotab(f)


            

Reported by Pylint.

Undefined variable 'baz'
Error

Line: 345 Column: 17

                                  or d):
                    foo()
            else:
                baz()
        self.check_jump_targets(f)
        self.check_lnotab(f)

    def test_elim_jump_to_uncond_jump2(self):
        # POP_JUMP_IF_FALSE to JUMP_ABSOLUTE --> POP_JUMP_IF_FALSE to non-jump

            

Reported by Pylint.

Using variable 'a' before assignment
Error

Line: 352 Column: 19

                  def test_elim_jump_to_uncond_jump2(self):
        # POP_JUMP_IF_FALSE to JUMP_ABSOLUTE --> POP_JUMP_IF_FALSE to non-jump
        def f():
            while a:
                # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    a = foo()
        self.check_jump_targets(f)

            

Reported by Pylint.

Undefined variable 'c'
Error

Line: 354 Column: 21

                      def f():
            while a:
                # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    a = foo()
        self.check_jump_targets(f)
        self.check_lnotab(f)


            

Reported by Pylint.

Undefined variable 'd'
Error

Line: 355 Column: 24

                          while a:
                # Intentionally use two-line expression to test issue37213.
                if (c
                    or d):
                    a = foo()
        self.check_jump_targets(f)
        self.check_lnotab(f)

    def test_elim_jump_to_uncond_jump3(self):

            

Reported by Pylint.

Lib/unittest/test/test_setups.py
161 issues
Missing module docstring
Error

Line: 1 Column: 1

              import io
import sys

import unittest


def resultFactory(*_):
    return unittest.TestResult()


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

              import unittest


def resultFactory(*_):
    return unittest.TestResult()


class TestSetups(unittest.TestCase):


            

Reported by Pylint.

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

Line: 7 Column: 1

              import unittest


def resultFactory(*_):
    return unittest.TestResult()


class TestSetups(unittest.TestCase):


            

Reported by Pylint.

Missing class docstring
Error

Line: 11 Column: 1

                  return unittest.TestResult()


class TestSetups(unittest.TestCase):

    def getRunner(self):
        return unittest.TextTestRunner(resultclass=resultFactory,
                                          stream=io.StringIO())
    def runTests(self, *cases):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 13 Column: 5

              
class TestSetups(unittest.TestCase):

    def getRunner(self):
        return unittest.TextTestRunner(resultclass=resultFactory,
                                          stream=io.StringIO())
    def runTests(self, *cases):
        suite = unittest.TestSuite()
        for case in cases:

            

Reported by Pylint.

Method could be a function
Error

Line: 13 Column: 5

              
class TestSetups(unittest.TestCase):

    def getRunner(self):
        return unittest.TextTestRunner(resultclass=resultFactory,
                                          stream=io.StringIO())
    def runTests(self, *cases):
        suite = unittest.TestSuite()
        for case in cases:

            

Reported by Pylint.

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

Line: 13 Column: 5

              
class TestSetups(unittest.TestCase):

    def getRunner(self):
        return unittest.TextTestRunner(resultclass=resultFactory,
                                          stream=io.StringIO())
    def runTests(self, *cases):
        suite = unittest.TestSuite()
        for case in cases:

            

Reported by Pylint.

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

Line: 16 Column: 5

                  def getRunner(self):
        return unittest.TextTestRunner(resultclass=resultFactory,
                                          stream=io.StringIO())
    def runTests(self, *cases):
        suite = unittest.TestSuite()
        for case in cases:
            tests = unittest.defaultTestLoader.loadTestsFromTestCase(case)
            suite.addTests(tests)


            

Reported by Pylint.

Missing function or method docstring
Error

Line: 16 Column: 5

                  def getRunner(self):
        return unittest.TextTestRunner(resultclass=resultFactory,
                                          stream=io.StringIO())
    def runTests(self, *cases):
        suite = unittest.TestSuite()
        for case in cases:
            tests = unittest.defaultTestLoader.loadTestsFromTestCase(case)
            suite.addTests(tests)


            

Reported by Pylint.

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

Line: 25 Column: 9

                      runner = self.getRunner()

        # creating a nested suite exposes some potential bugs
        realSuite = unittest.TestSuite()
        realSuite.addTest(suite)
        # adding empty suites to the end exposes potential bugs
        suite.addTest(unittest.TestSuite())
        realSuite.addTest(unittest.TestSuite())
        return runner.run(realSuite)

            

Reported by Pylint.

Lib/ctypes/test/test_byteswap.py
161 issues
Undefined variable 'BITS'
Error

Line: 21 Column: 20

                  def test_X(self):
        print(sys.byteorder, file=sys.stderr)
        for i in range(32):
            bits = BITS()
            setattr(bits, "i%s" % i, 1)
            dump(bits)

    def test_slots(self):
        class BigPoint(BigEndianStructure):

            

Reported by Pylint.

Undefined variable 'dump'
Error

Line: 23 Column: 13

                      for i in range(32):
            bits = BITS()
            setattr(bits, "i%s" % i, 1)
            dump(bits)

    def test_slots(self):
        class BigPoint(BigEndianStructure):
            __slots__ = ()
            _fields_ = [("x", c_int), ("y", c_int)]

            

Reported by Pylint.

class already defined line 179
Error

Line: 204 Column: 13

                      # these fields do not support different byte order:
        for typ in c_wchar, c_void_p, POINTER(c_int):
            _fields_.append(("x", typ))
            class T(base):
                pass
            self.assertRaises(TypeError, setattr, T, "_fields_", [("x", typ)])

    def test_struct_struct(self):
        # nested structures with different byteorders

            

Reported by Pylint.

Unused import create_string_buffer from wildcard import
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

Wildcard import ctypes
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

Unused import memmove from wildcard import
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

Unused import memset from wildcard import
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

Unused import PYFUNCTYPE from wildcard import
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

Unused import string_at from wildcard import
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

Unused import wstring_at from wildcard import
Error

Line: 4 Column: 1

              import sys, unittest, struct, math, ctypes
from binascii import hexlify

from ctypes import *

def bin(s):
    return hexlify(memoryview(s)).decode().upper()

# Each *simple* type that supports different byte orders has an

            

Reported by Pylint.

PC/layout/main.py
160 issues
Attempted relative import beyond top-level package
Error

Line: 26 Column: 1

                  # Started directly, so enable relative imports
    __path__ = [str(Path(__file__).resolve().parent)]

from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 27 Column: 1

                  __path__ = [str(Path(__file__).resolve().parent)]

from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

              
from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              from .support.appxmanifest import *
from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              from .support.catalog import *
from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 31 Column: 1

              from .support.constants import *
from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *

TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 32 Column: 1

              from .support.filesets import *
from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *

TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 33 Column: 1

              from .support.logging import *
from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *

TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 34 Column: 1

              from .support.options import *
from .support.pip import *
from .support.props import *
from .support.nuspec import *

TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")

IDLE_DIRS_ONLY = FileNameSet("idlelib")

            

Reported by Pylint.

Undefined variable 'FileStemSet'
Error

Line: 36 Column: 18

              from .support.props import *
from .support.nuspec import *

TEST_PYDS_ONLY = FileStemSet("xxlimited", "xxlimited_35", "_ctypes_test", "_test*")
TEST_DIRS_ONLY = FileNameSet("test", "tests")

IDLE_DIRS_ONLY = FileNameSet("idlelib")

TCLTK_PYDS_ONLY = FileStemSet("tcl*", "tk*", "_tkinter")

            

Reported by Pylint.

Lib/test/test_complex.py
160 issues
No name 'test_grammar' in module 'test'
Error

Line: 4 Column: 1

              import unittest
import sys
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
                               INVALID_UNDERSCORE_LITERALS)

from random import random
from math import atan2, isnan, copysign
import operator

            

Reported by Pylint.

Cannot import 'test.test_grammar' due to syntax error 'invalid syntax (<unknown>, line 763)'
Error

Line: 4 Column: 1

              import unittest
import sys
from test import support
from test.test_grammar import (VALID_UNDERSCORE_LITERALS,
                               INVALID_UNDERSCORE_LITERALS)

from random import random
from math import atan2, isnan, copysign
import operator

            

Reported by Pylint.

class already defined line 368
Error

Line: 491 Column: 9

                          def __complex__(self):
                return self

        class complex2(complex):
            """Make sure that __complex__() calls fail if anything other than a
            complex is returned"""
            def __complex__(self):
                return None


            

Reported by Pylint.

Parameters differ from overridden 'assertAlmostEqual' method
Error

Line: 25 Column: 5

              
class ComplexTest(unittest.TestCase):

    def assertAlmostEqual(self, a, b):
        if isinstance(a, complex):
            if isinstance(b, complex):
                unittest.TestCase.assertAlmostEqual(self, a.real, b.real)
                unittest.TestCase.assertAlmostEqual(self, a.imag, b.imag)
            else:

            

Reported by Pylint.

Unused variable 'i'
Error

Line: 107 Column: 13

                      self.check_div(complex(1e-200, 1e-200), 1+0j)

        # Just for fun.
        for i in range(100):
            self.check_div(complex(random(), random()),
                           complex(random(), random()))

        self.assertAlmostEqual(complex.__truediv__(2+0j, 1+1j), 1-1j)


            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 121 Column: 17

                  def test_truediv_zero_division(self):
        for a, b in ZERO_DIVISION:
            with self.assertRaises(ZeroDivisionError):
                a / b

    def test_floordiv(self):
        with self.assertRaises(TypeError):
            (1+1j) // (1+0j)
        with self.assertRaises(TypeError):

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 125 Column: 13

              
    def test_floordiv(self):
        with self.assertRaises(TypeError):
            (1+1j) // (1+0j)
        with self.assertRaises(TypeError):
            (1+1j) // 1.0
        with self.assertRaises(TypeError):
            (1+1j) // 1
        with self.assertRaises(TypeError):

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 127 Column: 13

                      with self.assertRaises(TypeError):
            (1+1j) // (1+0j)
        with self.assertRaises(TypeError):
            (1+1j) // 1.0
        with self.assertRaises(TypeError):
            (1+1j) // 1
        with self.assertRaises(TypeError):
            1.0 // (1+0j)
        with self.assertRaises(TypeError):

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 129 Column: 13

                      with self.assertRaises(TypeError):
            (1+1j) // 1.0
        with self.assertRaises(TypeError):
            (1+1j) // 1
        with self.assertRaises(TypeError):
            1.0 // (1+0j)
        with self.assertRaises(TypeError):
            1 // (1+0j)


            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 131 Column: 13

                      with self.assertRaises(TypeError):
            (1+1j) // 1
        with self.assertRaises(TypeError):
            1.0 // (1+0j)
        with self.assertRaises(TypeError):
            1 // (1+0j)

    def test_floordiv_zero_division(self):
        for a, b in ZERO_DIVISION:

            

Reported by Pylint.

Lib/idlelib/scrolledlist.py
158 issues
Unused import sys from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import CASCADE from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import CHECKBUTTON from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import COMMAND from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import RADIOBUTTON from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import SEPARATOR from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import SINGLE from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import BROWSE from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import MULTIPLE from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Unused import EXTENDED from wildcard import
Error

Line: 1 Column: 1

              from tkinter import *
from tkinter.ttk import Frame, Scrollbar

from idlelib import macosx


class ScrolledList:

    default = "(None)"

            

Reported by Pylint.

Lib/sqlite3/test/userfunctions.py
158 issues
Redefining name 'func' from outer scope (line 103)
Error

Line: 41 Column: 19

                  if traceback:
        strings.append('Traceback')

    def decorator(func):
        @functools.wraps(func)
        def wrapper(self, *args, **kwargs):
            # First, run the test with traceback enabled.
            with check_tracebacks(self, strings):
                func(self, *args, **kwargs)

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 84 Column: 5

              def func_returnlonglong():
    return 1<<31
def func_raiseexception():
    5/0
def func_memoryerror():
    raise MemoryError
def func_overflowerror():
    raise OverflowError


            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 122 Column: 9

              
class AggrExceptionInInit:
    def __init__(self):
        5/0

    def step(self, x):
        pass

    def finalize(self):

            

Reported by Pylint.

Unused argument 'x'
Error

Line: 134 Column: 20

                  def __init__(self):
        pass

    def step(self, x):
        5/0

    def finalize(self):
        return 42


            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 135 Column: 9

                      pass

    def step(self, x):
        5/0

    def finalize(self):
        return 42

class AggrExceptionInFinalize:

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 148 Column: 9

                      pass

    def finalize(self):
        5/0

class AggrCheckType:
    def __init__(self):
        self.val = None


            

Reported by Pylint.

Unused argument 't'
Error

Line: 407 Column: 20

                      # See bpo-44304: The destructor of the user function can
        # crash if is called without the GIL from the gc functions
        dest = sqlite.connect(':memory:')
        def md5sum(t):
            return

        dest.create_function("md5", 1, md5sum)
        x = dest("create table lang (name, first_appeared)")
        del md5sum, dest

            

Reported by Pylint.

Unused variable 'val'
Error

Line: 501 Column: 13

                      cur = self.con.cursor()
        with self.assertRaises(sqlite.OperationalError) as cm:
            cur.execute("select nofinalize(t) from test")
            val = cur.fetchone()[0]
        self.assertEqual(str(cm.exception), "user-defined aggregate's 'finalize' method raised error")

    @with_tracebacks(['__init__', '5/0', 'ZeroDivisionError'])
    def test_aggr_exception_in_init(self):
        cur = self.con.cursor()

            

Reported by Pylint.

Unused variable 'val'
Error

Line: 509 Column: 13

                      cur = self.con.cursor()
        with self.assertRaises(sqlite.OperationalError) as cm:
            cur.execute("select excInit(t) from test")
            val = cur.fetchone()[0]
        self.assertEqual(str(cm.exception), "user-defined aggregate's '__init__' method raised error")

    @with_tracebacks(['step', '5/0', 'ZeroDivisionError'])
    def test_aggr_exception_in_step(self):
        cur = self.con.cursor()

            

Reported by Pylint.

Unused variable 'val'
Error

Line: 517 Column: 13

                      cur = self.con.cursor()
        with self.assertRaises(sqlite.OperationalError) as cm:
            cur.execute("select excStep(t) from test")
            val = cur.fetchone()[0]
        self.assertEqual(str(cm.exception), "user-defined aggregate's 'step' method raised error")

    @with_tracebacks(['finalize', '5/0', 'ZeroDivisionError'])
    def test_aggr_exception_in_finalize(self):
        cur = self.con.cursor()

            

Reported by Pylint.