The following issues were found

Lib/test/test_range.py
141 issues
__index__ does not return int
Error

Line: 329 Column: 13

              
        # User-defined class with an invalid __index__ method
        class IN:
            def __index__(self):
                return "not a number"

        self.assertRaises(TypeError, range, IN())

        # Test use of user-defined classes in slice indices.

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 188 Column: 13

                      self.assertEqual(x[idx], a+idx)
        self.assertEqual(x[idx:idx+1][0], a+idx)
        with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

        a = 0
        b = 2 * sys.maxsize

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 190 Column: 13

                      with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

        a = 0
        b = 2 * sys.maxsize
        expected_len = b - a
        x = range(a, b)

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 206 Column: 13

                      self.assertEqual(x[idx], a+idx)
        self.assertEqual(x[idx:idx+1][0], a+idx)
        with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

        a = 0
        b = sys.maxsize**10

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 208 Column: 13

                      with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

        a = 0
        b = sys.maxsize**10
        c = 2*sys.maxsize
        expected_len = 1 + (b - a) // c

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 225 Column: 13

                      self.assertEqual(x[idx], a+(idx*c))
        self.assertEqual(x[idx:idx+1][0], a+(idx*c))
        with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

        a = sys.maxsize**10
        b = 0

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 227 Column: 13

                      with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

        a = sys.maxsize**10
        b = 0
        c = -2*sys.maxsize
        expected_len = 1 + (b - a) // c

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 244 Column: 13

                      self.assertEqual(x[idx], a+(idx*c))
        self.assertEqual(x[idx:idx+1][0], a+(idx*c))
        with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

    def test_invalid_invocation(self):
        self.assertRaises(TypeError, range)

            

Reported by Pylint.

Statement seems to have no effect
Error

Line: 246 Column: 13

                      with self.assertRaises(IndexError):
            x[-expected_len-1]
        with self.assertRaises(IndexError):
            x[expected_len]

    def test_invalid_invocation(self):
        self.assertRaises(TypeError, range)
        self.assertRaises(TypeError, range, 1, 2, 3, 4)
        self.assertRaises(ValueError, range, 1, 2, 0)

            

Reported by Pylint.

Expression "range(0, 10)[:IX()]" is assigned to nothing
Error

Line: 338 Column: 13

                      self.assertEqual(range(10)[:I(5)], range(5))

        with self.assertRaises(RuntimeError):
            range(0, 10)[:IX()]

        with self.assertRaises(TypeError):
            range(0, 10)[:IN()]

    def test_count(self):

            

Reported by Pylint.

Lib/lib2to3/pgen2/tokenize.py
140 issues
Attempted relative import beyond top-level package
Error

Line: 36 Column: 1

              from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

try:

            

Reported by Pylint.

Using variable 'strstart' before assignment
Error

Line: 372 Column: 62

              
        if contstr:                            # continued string
            if not line:
                raise TokenError("EOF in multi-line string", strstart)
            endmatch = endprog.match(line)
            if endmatch:
                pos = end = endmatch.end(0)
                yield (STRING, contstr + line[:end],
                       strstart, (lnum, end), contline + line)

            

Reported by Pylint.

Using variable 'endprog' before assignment
Error

Line: 373 Column: 24

                      if contstr:                            # continued string
            if not line:
                raise TokenError("EOF in multi-line string", strstart)
            endmatch = endprog.match(line)
            if endmatch:
                pos = end = endmatch.end(0)
                yield (STRING, contstr + line[:end],
                       strstart, (lnum, end), contline + line)
                contstr, needcont = '', 0

            

Reported by Pylint.

Unused import DOUBLESLASH from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Unused import DOUBLESTAREQUAL from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Unused import RIGHTSHIFTEQUAL from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Unused import LEFTSHIFTEQUAL from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Unused import CIRCUMFLEXEQUAL from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Unused import VBAREQUAL from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Unused import AMPEREQUAL from wildcard import
Error

Line: 34 Column: 1

              
import string, re
from codecs import BOM_UTF8, lookup
from lib2to3.pgen2.token import *

from . import token
__all__ = [x for x in dir(token) if x[0] != '_'] + ["tokenize",
           "generate_tokens", "untokenize"]
del token

            

Reported by Pylint.

Tools/scripts/fixcid.py
140 issues
Unused import S_IXUSR from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Wildcard import stat
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_IWUSR from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_IRUSR from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_IRWXU from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_IEXEC from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_IWRITE from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_IREAD from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_ISVTX from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Unused import S_ENFMT from wildcard import
Error

Line: 40 Column: 1

              import sys
import re
import os
from stat import *
import getopt

err = sys.stderr.write
dbg = err
rep = sys.stdout.write

            

Reported by Pylint.

Lib/unittest/test/test_discovery.py
139 issues
__init__ method from base class 'TestProgram' is not called
Error

Line: 24 Column: 5

                  progName = ''
    testRunner = testLoader = None

    def __init__(self):
        pass


class TestDiscovery(unittest.TestCase):


            

Reported by Pylint.

Access to a protected member _top_level_dir of a client class
Error

Line: 33 Column: 9

                  # Heavily mocked tests so I can avoid hitting the filesystem
    def test_get_name_from_path(self):
        loader = unittest.TestLoader()
        loader._top_level_dir = '/foo'
        name = loader._get_name_from_path('/foo/bar/baz.py')
        self.assertEqual(name, 'bar.baz')

        if not __debug__:
            # asserts are off

            

Reported by Pylint.

Access to a protected member _get_name_from_path of a client class
Error

Line: 34 Column: 16

                  def test_get_name_from_path(self):
        loader = unittest.TestLoader()
        loader._top_level_dir = '/foo'
        name = loader._get_name_from_path('/foo/bar/baz.py')
        self.assertEqual(name, 'bar.baz')

        if not __debug__:
            # asserts are off
            return

            

Reported by Pylint.

Access to a protected member _get_name_from_path of a client class
Error

Line: 42 Column: 13

                          return

        with self.assertRaises(AssertionError):
            loader._get_name_from_path('/bar/baz.py')

    def test_find_tests(self):
        loader = unittest.TestLoader()

        original_listdir = os.listdir

            

Reported by Pylint.

Access to a protected member _get_module_from_name of a client class
Error

Line: 74 Column: 9

                      os.path.isfile = isfile
        self.addCleanup(restore_isfile)

        loader._get_module_from_name = lambda path: path + ' module'
        orig_load_tests = loader.loadTestsFromModule
        def loadTestsFromModule(module, pattern=None):
            # This is where load_tests is called.
            base = orig_load_tests(module, pattern=pattern)
            return base + [module + ' tests']

            

Reported by Pylint.

Access to a protected member _top_level_dir of a client class
Error

Line: 84 Column: 9

                      loader.suiteClass = lambda thing: thing

        top_level = os.path.abspath('/foo')
        loader._top_level_dir = top_level
        suite = list(loader._find_tests(top_level, 'test*.py'))

        # The test suites found should be sorted alphabetically for reliable
        # execution order.
        expected = [[name + ' module tests'] for name in

            

Reported by Pylint.

Access to a protected member _find_tests of a client class
Error

Line: 85 Column: 22

              
        top_level = os.path.abspath('/foo')
        loader._top_level_dir = top_level
        suite = list(loader._find_tests(top_level, 'test*.py'))

        # The test suites found should be sorted alphabetically for reliable
        # execution order.
        expected = [[name + ' module tests'] for name in
                    ('test1', 'test2', 'test_dir')]

            

Reported by Pylint.

Access to a protected member _get_module_from_name of a client class
Error

Line: 120 Column: 9

                      os.path.isfile = lambda path: False
        self.addCleanup(restore_isfile)

        loader._get_module_from_name = lambda path: path + ' module'
        orig_load_tests = loader.loadTestsFromModule
        def loadTestsFromModule(module, pattern=None):
            # This is where load_tests is called.
            base = orig_load_tests(module, pattern=pattern)
            return base + [module + ' tests']

            

Reported by Pylint.

Access to a protected member _top_level_dir of a client class
Error

Line: 130 Column: 9

                      loader.suiteClass = lambda thing: thing

        top_level = os.path.abspath('/foo')
        loader._top_level_dir = top_level
        suite = list(loader._find_tests(top_level, 'test*.py'))

        self.assertEqual(suite, [])

    def test_find_tests_with_package(self):

            

Reported by Pylint.

Access to a protected member _find_tests of a client class
Error

Line: 131 Column: 22

              
        top_level = os.path.abspath('/foo')
        loader._top_level_dir = top_level
        suite = list(loader._find_tests(top_level, 'test*.py'))

        self.assertEqual(suite, [])

    def test_find_tests_with_package(self):
        loader = unittest.TestLoader()

            

Reported by Pylint.

Lib/test/test_asyncio/test_sslproto.py
139 issues
Instance of 'BaseStartTLS' has no 'assertEqual' member
Error

Line: 196 Column: 13

                      for usemv in [False, True]:
            proto = Proto(1, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'12345')
            self.assertEqual(proto.data, b'12345')

            proto = Proto(2, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'12345')
            self.assertEqual(proto.data, b'12345')


            

Reported by Pylint.

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

Line: 200 Column: 13

              
            proto = Proto(2, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'12345')
            self.assertEqual(proto.data, b'12345')

            proto = Proto(2, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'1234')
            self.assertEqual(proto.data, b'1234')


            

Reported by Pylint.

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

Line: 204 Column: 13

              
            proto = Proto(2, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'1234')
            self.assertEqual(proto.data, b'1234')

            proto = Proto(4, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'1234')
            self.assertEqual(proto.data, b'1234')


            

Reported by Pylint.

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

Line: 208 Column: 13

              
            proto = Proto(4, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'1234')
            self.assertEqual(proto.data, b'1234')

            proto = Proto(100, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'12345')
            self.assertEqual(proto.data, b'12345')


            

Reported by Pylint.

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

Line: 212 Column: 13

              
            proto = Proto(100, usemv)
            protocols._feed_data_to_buffered_proto(proto, b'12345')
            self.assertEqual(proto.data, b'12345')

            proto = Proto(0, usemv)
            with self.assertRaisesRegex(RuntimeError, 'empty buffer'):
                protocols._feed_data_to_buffered_proto(proto, b'12345')


            

Reported by Pylint.

Instance of 'BaseStartTLS' has no 'assertRaisesRegex' member
Error

Line: 215 Column: 18

                          self.assertEqual(proto.data, b'12345')

            proto = Proto(0, usemv)
            with self.assertRaisesRegex(RuntimeError, 'empty buffer'):
                protocols._feed_data_to_buffered_proto(proto, b'12345')

    def test_start_tls_client_reg_proto_1(self):
        HELLO_MSG = b'1' * self.PAYLOAD_SIZE


            

Reported by Pylint.

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

Line: 228 Column: 13

                          sock.settimeout(self.TIMEOUT)

            data = sock.recv_all(len(HELLO_MSG))
            self.assertEqual(len(data), len(HELLO_MSG))

            sock.start_tls(server_context, server_side=True)

            sock.sendall(b'O')
            data = sock.recv_all(len(HELLO_MSG))

            

Reported by Pylint.

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

Line: 234 Column: 13

              
            sock.sendall(b'O')
            data = sock.recv_all(len(HELLO_MSG))
            self.assertEqual(len(data), len(HELLO_MSG))

            sock.shutdown(socket.SHUT_RDWR)
            sock.close()

        class ClientProto(asyncio.Protocol):

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 245 Column: 13

                              self.on_eof = on_eof
                self.con_made_cnt = 0

            def connection_made(proto, tr):
                proto.con_made_cnt += 1
                # Ensure connection_made gets called only once.
                self.assertEqual(proto.con_made_cnt, 1)

            def data_received(self, data):

            

Reported by Pylint.

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

Line: 248 Column: 17

                          def connection_made(proto, tr):
                proto.con_made_cnt += 1
                # Ensure connection_made gets called only once.
                self.assertEqual(proto.con_made_cnt, 1)

            def data_received(self, data):
                self.on_data.set_result(data)

            def eof_received(self):

            

Reported by Pylint.

Doc/tools/extensions/pyspecific.py
138 issues
Unable to import 'docutils.io'
Error

Line: 17 Column: 1

              from os import getenv, path
from time import asctime
from pprint import pformat
from docutils.io import StringOutput
from docutils.parsers.rst import Directive
from docutils.utils import new_document

from docutils import nodes, utils


            

Reported by Pylint.

Unable to import 'docutils.parsers.rst'
Error

Line: 18 Column: 1

              from time import asctime
from pprint import pformat
from docutils.io import StringOutput
from docutils.parsers.rst import Directive
from docutils.utils import new_document

from docutils import nodes, utils

from sphinx import addnodes

            

Reported by Pylint.

Unable to import 'docutils.utils'
Error

Line: 19 Column: 1

              from pprint import pformat
from docutils.io import StringOutput
from docutils.parsers.rst import Directive
from docutils.utils import new_document

from docutils import nodes, utils

from sphinx import addnodes
from sphinx.builders import Builder

            

Reported by Pylint.

Unable to import 'docutils'
Error

Line: 21 Column: 1

              from docutils.parsers.rst import Directive
from docutils.utils import new_document

from docutils import nodes, utils

from sphinx import addnodes
from sphinx.builders import Builder
try:
    from sphinx.errors import NoUri

            

Reported by Pylint.

Unable to import 'sphinx'
Error

Line: 23 Column: 1

              
from docutils import nodes, utils

from sphinx import addnodes
from sphinx.builders import Builder
try:
    from sphinx.errors import NoUri
except ImportError:
    from sphinx.environment import NoUri

            

Reported by Pylint.

Unable to import 'sphinx.builders'
Error

Line: 24 Column: 1

              from docutils import nodes, utils

from sphinx import addnodes
from sphinx.builders import Builder
try:
    from sphinx.errors import NoUri
except ImportError:
    from sphinx.environment import NoUri
from sphinx.locale import translators

            

Reported by Pylint.

Unable to import 'sphinx.locale'
Error

Line: 29 Column: 1

                  from sphinx.errors import NoUri
except ImportError:
    from sphinx.environment import NoUri
from sphinx.locale import translators
from sphinx.util import status_iterator, logging
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.text import TextWriter, TextTranslator
from sphinx.writers.latex import LaTeXTranslator


            

Reported by Pylint.

Unable to import 'sphinx.util'
Error

Line: 30 Column: 1

              except ImportError:
    from sphinx.environment import NoUri
from sphinx.locale import translators
from sphinx.util import status_iterator, logging
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.text import TextWriter, TextTranslator
from sphinx.writers.latex import LaTeXTranslator

try:

            

Reported by Pylint.

Unable to import 'sphinx.util.nodes'
Error

Line: 31 Column: 1

                  from sphinx.environment import NoUri
from sphinx.locale import translators
from sphinx.util import status_iterator, logging
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.text import TextWriter, TextTranslator
from sphinx.writers.latex import LaTeXTranslator

try:
    from sphinx.domains.python import PyFunction, PyMethod

            

Reported by Pylint.

Unable to import 'sphinx.writers.text'
Error

Line: 32 Column: 1

              from sphinx.locale import translators
from sphinx.util import status_iterator, logging
from sphinx.util.nodes import split_explicit_title
from sphinx.writers.text import TextWriter, TextTranslator
from sphinx.writers.latex import LaTeXTranslator

try:
    from sphinx.domains.python import PyFunction, PyMethod
except ImportError:

            

Reported by Pylint.

Lib/ctypes/test/test_as_parameter.py
138 issues
Unused import c_uint16 from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import c_int8 from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import RTLD_GLOBAL from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import DllCanUnloadNow from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import DllGetClassObject from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import wstring_at from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import string_at from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import cast from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import PYFUNCTYPE from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Unused import memset from wildcard import
Error

Line: 2 Column: 1

              import unittest
from ctypes import *
from ctypes.test import need_symbol
import _ctypes_test

dll = CDLL(_ctypes_test.__file__)

try:
    CALLBACK_FUNCTYPE = WINFUNCTYPE

            

Reported by Pylint.

Lib/test/test_decorators.py
136 issues
Method 'foo' has no 'abc' member
Error

Line: 215 Column: 26

                          @funcattrs(booh=42)
            def foo(self): return 42
        self.assertEqual(C().foo(), 42)
        self.assertEqual(C.foo.abc, 1)
        self.assertEqual(C.foo.xyz, "haha")
        self.assertEqual(C.foo.booh, 42)

    def test_order(self):
        # Test that decorators are applied in the proper order to the function

            

Reported by Pylint.

Method 'foo' has no 'xyz' member
Error

Line: 216 Column: 26

                          def foo(self): return 42
        self.assertEqual(C().foo(), 42)
        self.assertEqual(C.foo.abc, 1)
        self.assertEqual(C.foo.xyz, "haha")
        self.assertEqual(C.foo.booh, 42)

    def test_order(self):
        # Test that decorators are applied in the proper order to the function
        # they are decorating.

            

Reported by Pylint.

Method 'foo' has no 'booh' member
Error

Line: 217 Column: 26

                      self.assertEqual(C().foo(), 42)
        self.assertEqual(C.foo.abc, 1)
        self.assertEqual(C.foo.xyz, "haha")
        self.assertEqual(C.foo.booh, 42)

    def test_order(self):
        # Test that decorators are applied in the proper order to the function
        # they are decorating.
        def callnum(num):

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 365 Column: 17

                      for myclassmethod in [MyClassMethod1, MyClassMethod2]:
            class A:
                @myclassmethod
                def f1(cls):
                    return cls

                @classmethod
                @myclassmethod
                def f2(cls):

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 385 Column: 17

              
                @myclassmethod
                @MyClassMethod1
                def f5(cls):
                    return cls

                @myclassmethod
                @MyClassMethod2
                def f6(cls):

            

Reported by Pylint.

Method should have "self" as first argument
Error

Line: 390 Column: 17

              
                @myclassmethod
                @MyClassMethod2
                def f6(cls):
                    return cls

            self.assertIs(A.f1(), A)
            self.assertIs(A.f2(), A)
            self.assertIs(A.f3(), A)

            

Reported by Pylint.

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

Line: 393 Column: 27

                              def f6(cls):
                    return cls

            self.assertIs(A.f1(), A)
            self.assertIs(A.f2(), A)
            self.assertIs(A.f3(), A)
            self.assertIs(A.f4(), A)
            self.assertIs(A.f5(), A)
            self.assertIs(A.f6(), A)

            

Reported by Pylint.

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

Line: 397 Column: 27

                          self.assertIs(A.f2(), A)
            self.assertIs(A.f3(), A)
            self.assertIs(A.f4(), A)
            self.assertIs(A.f5(), A)
            self.assertIs(A.f6(), A)
            a = A()
            self.assertIs(a.f1(), A)
            self.assertIs(a.f2(), A)
            self.assertIs(a.f3(), A)

            

Reported by Pylint.

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

Line: 398 Column: 27

                          self.assertIs(A.f3(), A)
            self.assertIs(A.f4(), A)
            self.assertIs(A.f5(), A)
            self.assertIs(A.f6(), A)
            a = A()
            self.assertIs(a.f1(), A)
            self.assertIs(a.f2(), A)
            self.assertIs(a.f3(), A)
            self.assertIs(a.f4(), A)

            

Reported by Pylint.

Class 'C' has no 'extra' member
Error

Line: 427 Column: 26

                          return x
        @plain
        class C(object): pass
        self.assertEqual(C.extra, 'Hello')

    def test_double(self):
        def ten(x):
            x.extra = 10
            return x

            

Reported by Pylint.

Lib/tokenize.py
136 issues
Using variable 'strstart' before assignment
Error

Line: 463 Column: 62

              
        if contstr:                            # continued string
            if not line:
                raise TokenError("EOF in multi-line string", strstart)
            endmatch = endprog.match(line)
            if endmatch:
                pos = end = endmatch.end(0)
                yield TokenInfo(STRING, contstr + line[:end],
                       strstart, (lnum, end), contline + line)

            

Reported by Pylint.

Using variable 'endprog' before assignment
Error

Line: 464 Column: 24

                      if contstr:                            # continued string
            if not line:
                raise TokenError("EOF in multi-line string", strstart)
            endmatch = endprog.match(line)
            if endmatch:
                pos = end = endmatch.end(0)
                yield TokenInfo(STRING, contstr + line[:end],
                       strstart, (lnum, end), contline + line)
                contstr, needcont = '', 0

            

Reported by Pylint.

Unused import COLON from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Wildcard import token
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Unused import LSQB from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Unused import RSQB from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Unused import COMMA from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Unused import CIRCUMFLEXEQUAL from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Unused import VBAREQUAL from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Unused import AMPEREQUAL from wildcard import
Error

Line: 35 Column: 1

              import itertools as _itertools
import re
import sys
from token import *
from token import EXACT_TOKEN_TYPES

cookie_re = re.compile(r'^[ \t\f]*#.*?coding[:=][ \t]*([-\w.]+)', re.ASCII)
blank_re = re.compile(br'^[ \t\f]*(?:[#\r\n]|$)', re.ASCII)


            

Reported by Pylint.

Lib/multiprocessing/pool.py
136 issues
Cannot import 'traceback' due to syntax error 'invalid syntax (<unknown>, line 576)'
Error

Line: 22 Column: 1

              import queue
import threading
import time
import traceback
import types
import warnings

# If threading is available then ThreadPool should be provided.  Therefore
# we avoid top-level imports which are liable to fail on some systems.

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 28 Column: 1

              
# If threading is available then ThreadPool should be provided.  Therefore
# we avoid top-level imports which are liable to fail on some systems.
from . import util
from . import get_context, TimeoutError
from .connection import wait

#
# Constants representing the state of a pool

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 29 Column: 1

              # If threading is available then ThreadPool should be provided.  Therefore
# we avoid top-level imports which are liable to fail on some systems.
from . import util
from . import get_context, TimeoutError
from .connection import wait

#
# Constants representing the state of a pool
#

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 30 Column: 1

              # we avoid top-level imports which are liable to fail on some systems.
from . import util
from . import get_context, TimeoutError
from .connection import wait

#
# Constants representing the state of a pool
#


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 923 Column: 9

              
    @staticmethod
    def Process(ctx, *args, **kwds):
        from .dummy import Process
        return Process(*args, **kwds)

    def __init__(self, processes=None, initializer=None, initargs=()):
        Pool.__init__(self, processes, initializer, initargs)


            

Reported by Pylint.

Redefining built-in 'TimeoutError'
Error

Line: 29 Column: 1

              # If threading is available then ThreadPool should be provided.  Therefore
# we avoid top-level imports which are liable to fail on some systems.
from . import util
from . import get_context, TimeoutError
from .connection import wait

#
# Constants representing the state of a pool
#

            

Reported by Pylint.

__init__ method from base class 'Exception' is not called
Error

Line: 58 Column: 5

              #

class RemoteTraceback(Exception):
    def __init__(self, tb):
        self.tb = tb
    def __str__(self):
        return self.tb

class ExceptionWithTraceback:

            

Reported by Pylint.

Access to a protected member _writer of a client class
Error

Line: 105 Column: 9

                  put = outqueue.put
    get = inqueue.get
    if hasattr(inqueue, '_writer'):
        inqueue._writer.close()
        outqueue._reader.close()

    if initializer is not None:
        initializer(*initargs)


            

Reported by Pylint.

Access to a protected member _reader of a client class
Error

Line: 106 Column: 9

                  get = inqueue.get
    if hasattr(inqueue, '_writer'):
        inqueue._writer.close()
        outqueue._reader.close()

    if initializer is not None:
        initializer(*initargs)

    completed = 0

            

Reported by Pylint.

Catching too general exception Exception
Error

Line: 126 Column: 16

                      job, i, func, args, kwds = task
        try:
            result = (True, func(*args, **kwds))
        except Exception as e:
            if wrap_exception and func is not _helper_reraises_exception:
                e = ExceptionWithTraceback(e, e.__traceback__)
            result = (False, e)
        try:
            put((job, i, result))

            

Reported by Pylint.