The following issues were found

Lib/test/test_graphlib.py
36 issues
The raise statement is not inside an except clause
Error

Line: 34 Column: 13

                          msg, seq = e.args
            self.assertIn(" ".join(map(str, cycle)), " ".join(map(str, seq * 2)))
        else:
            raise

    def test_simple_cases(self):
        self._test_graph(
            {2: {11}, 9: {11, 8}, 10: {11, 3}, 11: {7, 5}, 8: {7, 3}},
            [(3, 5, 7), (11, 8), (2, 10, 9)],

            

Reported by Pylint.

Possible unbalanced tuple unpacking with sequence: left side has 2 label(s), right side has 1 value(s)
Error

Line: 31 Column: 13

                      try:
            ts.prepare()
        except graphlib.CycleError as e:
            msg, seq = e.args
            self.assertIn(" ".join(map(str, cycle)), " ".join(map(str, seq * 2)))
        else:
            raise

    def test_simple_cases(self):

            

Reported by Pylint.

Unused variable 'msg'
Error

Line: 31 Column: 13

                      try:
            ts.prepare()
        except graphlib.CycleError as e:
            msg, seq = e.args
            self.assertIn(" ".join(map(str, cycle)), " ".join(map(str, seq * 2)))
        else:
            raise

    def test_simple_cases(self):

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from itertools import chain
import graphlib
import os
import unittest

from test.support.script_helper import assert_python_ok

class TestTopologicalSort(unittest.TestCase):
    def _test_graph(self, graph, expected):

            

Reported by Pylint.

Missing class docstring
Error

Line: 8 Column: 1

              
from test.support.script_helper import assert_python_ok

class TestTopologicalSort(unittest.TestCase):
    def _test_graph(self, graph, expected):
        def static_order_with_groups(ts):
            ts.prepare()
            while ts.is_active():
                nodes = ts.get_ready()

            

Reported by Pylint.

Argument name "ts" doesn't conform to snake_case naming style
Error

Line: 10 Column: 9

              
class TestTopologicalSort(unittest.TestCase):
    def _test_graph(self, graph, expected):
        def static_order_with_groups(ts):
            ts.prepare()
            while ts.is_active():
                nodes = ts.get_ready()
                for node in nodes:
                    ts.done(node)

            

Reported by Pylint.

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

Line: 18 Column: 9

                                  ts.done(node)
                yield nodes

        ts = graphlib.TopologicalSorter(graph)
        self.assertEqual(list(static_order_with_groups(ts)), list(expected))

        ts = graphlib.TopologicalSorter(graph)
        self.assertEqual(list(ts.static_order()), list(chain(*expected)))


            

Reported by Pylint.

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

Line: 21 Column: 9

                      ts = graphlib.TopologicalSorter(graph)
        self.assertEqual(list(static_order_with_groups(ts)), list(expected))

        ts = graphlib.TopologicalSorter(graph)
        self.assertEqual(list(ts.static_order()), list(chain(*expected)))

    def _assert_cycle(self, graph, cycle):
        ts = graphlib.TopologicalSorter()
        for node, dependson in graph.items():

            

Reported by Pylint.

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

Line: 25 Column: 9

                      self.assertEqual(list(ts.static_order()), list(chain(*expected)))

    def _assert_cycle(self, graph, cycle):
        ts = graphlib.TopologicalSorter()
        for node, dependson in graph.items():
            ts.add(node, *dependson)
        try:
            ts.prepare()
        except graphlib.CycleError as e:

            

Reported by Pylint.

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

Line: 30 Column: 9

                          ts.add(node, *dependson)
        try:
            ts.prepare()
        except graphlib.CycleError as e:
            msg, seq = e.args
            self.assertIn(" ".join(map(str, cycle)), " ".join(map(str, seq * 2)))
        else:
            raise


            

Reported by Pylint.

Lib/multiprocessing/forkserver.py
36 issues
Attempted relative import beyond top-level package
Error

Line: 11 Column: 1

              import threading
import warnings

from . import connection
from . import process
from .context import reduction
from . import resource_tracker
from . import spawn
from . import util

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 12 Column: 1

              import warnings

from . import connection
from . import process
from .context import reduction
from . import resource_tracker
from . import spawn
from . import util


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 13 Column: 1

              
from . import connection
from . import process
from .context import reduction
from . import resource_tracker
from . import spawn
from . import util

__all__ = ['ensure_running', 'get_inherited_fds', 'connect_to_new_process',

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 14 Column: 1

              from . import connection
from . import process
from .context import reduction
from . import resource_tracker
from . import spawn
from . import util

__all__ = ['ensure_running', 'get_inherited_fds', 'connect_to_new_process',
           'set_forkserver_preload']

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 15 Column: 1

              from . import process
from .context import reduction
from . import resource_tracker
from . import spawn
from . import util

__all__ = ['ensure_running', 'get_inherited_fds', 'connect_to_new_process',
           'set_forkserver_preload']


            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 16 Column: 1

              from .context import reduction
from . import resource_tracker
from . import spawn
from . import util

__all__ = ['ensure_running', 'get_inherited_fds', 'connect_to_new_process',
           'set_forkserver_preload']

#

            

Reported by Pylint.

Module 'os' has no 'waitstatus_to_exitcode' member
Error

Line: 240 Column: 42

                                          break
                        child_w = pid_to_fd.pop(pid, None)
                        if child_w is not None:
                            returncode = os.waitstatus_to_exitcode(sts)

                            # Send exit code to client process
                            try:
                                write_signed(child_w, returncode)
                            except BrokenPipeError:

            

Reported by Pylint.

Unused variable 'status'
Error

Line: 116 Column: 22

                          resource_tracker.ensure_running()
            if self._forkserver_pid is not None:
                # forkserver was launched before, is it still running?
                pid, status = os.waitpid(self._forkserver_pid, os.WNOHANG)
                if not pid:
                    # still alive
                    return
                # dead, launch it again
                os.close(self._forkserver_alive_fd)

            

Reported by Pylint.

Access to a protected member _args_from_interpreter_flags of a client class
Error

Line: 151 Column: 36

                                  cmd %= (listener.fileno(), alive_r, self._preload_modules,
                            data)
                    exe = spawn.get_executable()
                    args = [exe] + util._args_from_interpreter_flags()
                    args += ['-c', cmd]
                    pid = util.spawnv_passfds(exe, args, fds_to_pass)
                except:
                    os.close(alive_w)
                    raise

            

Reported by Pylint.

Unused argument 'sys_path'
Error

Line: 167 Column: 57

              #
#

def main(listener_fd, alive_r, preload, main_path=None, sys_path=None):
    '''Run forkserver.'''
    if preload:
        if '__main__' in preload and main_path is not None:
            process.current_process()._inheriting = True
            try:

            

Reported by Pylint.

Lib/idlelib/idle_test/test_editor.py
36 issues
Method should have "self" as first argument
Error

Line: 205 Column: 9

                      del cls.root

    class DummyRMenu:
        def tk_popup(x, y): pass

    def test_rclick(self):
        pass



            

Reported by Pylint.

Unused Func imported from idlelib.idle_test.mock_idle
Error

Line: 8 Column: 1

              from collections import namedtuple
from test.support import requires
from tkinter import Tk
from idlelib.idle_test.mock_idle import Func

Editor = editor.EditorWindow


class EditorWindowTest(unittest.TestCase):

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 24 Column: 13

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

    def test_init(self):

            

Reported by Pylint.

Access to a protected member _close of a client class
Error

Line: 32 Column: 9

                  def test_init(self):
        e = Editor(root=self.root)
        self.assertEqual(e.root, self.root)
        e._close()


class TestGetLineIndent(unittest.TestCase):
    def test_empty_lines(self):
        for tabwidth in [1, 2, 4, 6, 8]:

            

Reported by Pylint.

Access to a protected member _close of a client class
Error

Line: 115 Column: 9

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

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 118 Column: 13

                      cls.window._close()
        del cls.window
        cls.root.update_idletasks()
        for id in cls.root.tk.call('after', 'info'):
            cls.root.after_cancel(id)
        cls.root.destroy()
        del cls.root

    def test_indent_and_newline_event(self):

            

Reported by Pylint.

Access to a protected member _close of a client class
Error

Line: 196 Column: 9

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

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 199 Column: 13

                      cls.window._close()
        del cls.window
        cls.root.update_idletasks()
        for id in cls.root.tk.call('after', 'info'):
            cls.root.after_cancel(id)
        cls.root.destroy()
        del cls.root

    class DummyRMenu:

            

Reported by Pylint.

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

Line: 4 Column: 1

              "Test editor, coverage 35%."

from idlelib import editor
import unittest
from collections import namedtuple
from test.support import requires
from tkinter import Tk
from idlelib.idle_test.mock_idle import Func


            

Reported by Pylint.

standard import "from collections import namedtuple" should be placed before "from idlelib import editor"
Error

Line: 5 Column: 1

              
from idlelib import editor
import unittest
from collections import namedtuple
from test.support import requires
from tkinter import Tk
from idlelib.idle_test.mock_idle import Func

Editor = editor.EditorWindow

            

Reported by Pylint.

Lib/distutils/tests/test_util.py
36 issues
Access to a protected member _config_vars of a client class
Error

Line: 32 Column: 34

                      self.join = os.path.join
        self.isabs = os.path.isabs
        self.splitdrive = os.path.splitdrive
        self._config_vars = copy(sysconfig._config_vars)

        # patching os.uname
        if hasattr(os, 'uname'):
            self.uname = os.uname
            self._uname = os.uname()

            

Reported by Pylint.

Access to a protected member _config_vars of a client class
Error

Line: 57 Column: 9

                          os.uname = self.uname
        else:
            del os.uname
        sysconfig._config_vars.clear()
        sysconfig._config_vars.update(self._config_vars)
        super(UtilTestCase, self).tearDown()

    def _set_uname(self, uname):
        self._uname = uname

            

Reported by Pylint.

Access to a protected member _config_vars of a client class
Error

Line: 58 Column: 9

                      else:
            del os.uname
        sysconfig._config_vars.clear()
        sysconfig._config_vars.update(self._config_vars)
        super(UtilTestCase, self).tearDown()

    def _set_uname(self, uname):
        self._uname = uname


            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 92 Column: 9

                                 ('Darwin Kernel Version 8.11.1: '
                    'Wed Oct 10 18:23:28 PDT 2007; '
                    'root:xnu-792.25.20~1/RELEASE_I386'), 'i386'))
        _osx_support._remove_original_values(get_config_vars())
        get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.3'

        get_config_vars()['CFLAGS'] = ('-fno-strict-aliasing -DNDEBUG -g '
                                       '-fwrapv -O3 -Wall -Wstrict-prototypes')


            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 106 Column: 9

                          sys.maxsize = cursize

        # macbook with fat binaries (fat, universal or fat64)
        _osx_support._remove_original_values(get_config_vars())
        get_config_vars()['MACOSX_DEPLOYMENT_TARGET'] = '10.4'
        get_config_vars()['CFLAGS'] = ('-arch ppc -arch i386 -isysroot '
                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
                                       '-fno-strict-aliasing -fno-common '
                                       '-dynamic -DNDEBUG -g -O3')

            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 115 Column: 9

              
        self.assertEqual(get_platform(), 'macosx-10.4-fat')

        _osx_support._remove_original_values(get_config_vars())
        os.environ['MACOSX_DEPLOYMENT_TARGET'] = '10.1'
        self.assertEqual(get_platform(), 'macosx-10.4-fat')


        _osx_support._remove_original_values(get_config_vars())

            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 120 Column: 9

                      self.assertEqual(get_platform(), 'macosx-10.4-fat')


        _osx_support._remove_original_values(get_config_vars())
        get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch i386 -isysroot '
                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
                                       '-fno-strict-aliasing -fno-common '
                                       '-dynamic -DNDEBUG -g -O3')


            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 128 Column: 9

              
        self.assertEqual(get_platform(), 'macosx-10.4-intel')

        _osx_support._remove_original_values(get_config_vars())
        get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc -arch i386 -isysroot '
                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
                                       '-fno-strict-aliasing -fno-common '
                                       '-dynamic -DNDEBUG -g -O3')
        self.assertEqual(get_platform(), 'macosx-10.4-fat3')

            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 135 Column: 9

                                                     '-dynamic -DNDEBUG -g -O3')
        self.assertEqual(get_platform(), 'macosx-10.4-fat3')

        _osx_support._remove_original_values(get_config_vars())
        get_config_vars()['CFLAGS'] = ('-arch ppc64 -arch x86_64 -arch ppc -arch i386 -isysroot '
                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
                                       '-fno-strict-aliasing -fno-common '
                                       '-dynamic -DNDEBUG -g -O3')
        self.assertEqual(get_platform(), 'macosx-10.4-universal')

            

Reported by Pylint.

Access to a protected member _remove_original_values of a client class
Error

Line: 142 Column: 9

                                                     '-dynamic -DNDEBUG -g -O3')
        self.assertEqual(get_platform(), 'macosx-10.4-universal')

        _osx_support._remove_original_values(get_config_vars())
        get_config_vars()['CFLAGS'] = ('-arch x86_64 -arch ppc64 -isysroot '
                                       '/Developer/SDKs/MacOSX10.4u.sdk  '
                                       '-fno-strict-aliasing -fno-common '
                                       '-dynamic -DNDEBUG -g -O3')


            

Reported by Pylint.

Lib/idlelib/idle_test/test_config_key.py
36 issues
Access to a protected member _name of a client class
Error

Line: 134 Column: 20

                          below another one.
            """
            for index, child in enumerate(dialog.frame.winfo_children()):
                if child._name == 'keyseq_basic':
                    basic = index
                if child._name == 'keyseq_advanced':
                    advanced = index
            return basic, advanced


            

Reported by Pylint.

Access to a protected member _name of a client class
Error

Line: 136 Column: 20

                          for index, child in enumerate(dialog.frame.winfo_children()):
                if child._name == 'keyseq_basic':
                    basic = index
                if child._name == 'keyseq_advanced':
                    advanced = index
            return basic, advanced

        # New window starts at basic level.
        self.assertFalse(dialog.advanced)

            

Reported by Pylint.

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

Line: 9 Column: 1

              """

from idlelib import config_key
from test.support import requires
import unittest
from unittest import mock
from tkinter import Tk, TclError
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox_func

            

Reported by Pylint.

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

Line: 10 Column: 1

              
from idlelib import config_key
from test.support import requires
import unittest
from unittest import mock
from tkinter import Tk, TclError
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox_func


            

Reported by Pylint.

standard import "from unittest import mock" should be placed before "from idlelib import config_key"
Error

Line: 11 Column: 1

              from idlelib import config_key
from test.support import requires
import unittest
from unittest import mock
from tkinter import Tk, TclError
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox_func

gkd = config_key.GetKeysDialog

            

Reported by Pylint.

standard import "from tkinter import Tk, TclError" should be placed before "from idlelib import config_key"
Error

Line: 12 Column: 1

              from test.support import requires
import unittest
from unittest import mock
from tkinter import Tk, TclError
from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox_func

gkd = config_key.GetKeysDialog


            

Reported by Pylint.

Class name "gkd" doesn't conform to PascalCase naming style
Error

Line: 16 Column: 1

              from idlelib.idle_test.mock_idle import Func
from idlelib.idle_test.mock_tk import Mbox_func

gkd = config_key.GetKeysDialog


class ValidationTest(unittest.TestCase):
    "Test validation methods: ok, keys_ok, bind_ok."


            

Reported by Pylint.

Missing class docstring
Error

Line: 22 Column: 5

              class ValidationTest(unittest.TestCase):
    "Test validation methods: ok, keys_ok, bind_ok."

    class Validator(gkd):
        def __init__(self, *args, **kwargs):
            config_key.GetKeysDialog.__init__(self, *args, **kwargs)
            class list_keys_final:
                get = Func()
            self.list_keys_final = list_keys_final

            

Reported by Pylint.

Missing class docstring
Error

Line: 25 Column: 13

                  class Validator(gkd):
        def __init__(self, *args, **kwargs):
            config_key.GetKeysDialog.__init__(self, *args, **kwargs)
            class list_keys_final:
                get = Func()
            self.list_keys_final = list_keys_final
        get_modifiers = Func()
        showerror = Mbox_func()


            

Reported by Pylint.

Class name "list_keys_final" doesn't conform to PascalCase naming style
Error

Line: 25 Column: 13

                  class Validator(gkd):
        def __init__(self, *args, **kwargs):
            config_key.GetKeysDialog.__init__(self, *args, **kwargs)
            class list_keys_final:
                get = Func()
            self.list_keys_final = list_keys_final
        get_modifiers = Func()
        showerror = Mbox_func()


            

Reported by Pylint.

Lib/encodings/punycode.py
36 issues
Redefining built-in 'str'
Error

Line: 10 Column: 15

              
##################### Encoding #####################################

def segregate(str):
    """3.1 Basic code point segregation"""
    base = bytearray()
    extended = set()
    for c in str:
        if ord(c) < 128:

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 22 Column: 19

                  extended = sorted(extended)
    return bytes(base), extended

def selective_len(str, max):
    """Return the length of str, considering only characters below max."""
    res = 0
    for c in str:
        if ord(c) < max:
            res += 1

            

Reported by Pylint.

Redefining built-in 'max'
Error

Line: 22 Column: 24

                  extended = sorted(extended)
    return bytes(base), extended

def selective_len(str, max):
    """Return the length of str, considering only characters below max."""
    res = 0
    for c in str:
        if ord(c) < max:
            res += 1

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 30 Column: 20

                          res += 1
    return res

def selective_find(str, char, index, pos):
    """Return a pair (index, pos), indicating the next occurrence of
    char in str. index is the position of the character considering
    only ordinals up to and including char, and pos is the position in
    the full string. index/pos is the starting position in the full
    string."""

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 48 Column: 22

                      elif c < char:
            index += 1

def insertion_unsort(str, extended):
    """3.2 Insertion unsort coding"""
    oldchar = 0x80
    result = []
    oldindex = -1
    for c in extended:

            

Reported by Pylint.

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

Line: 137 Column: 17

                          char = ord(extended[extpos])
        except IndexError:
            if errors == "strict":
                raise UnicodeError("incomplete punicode string")
            return extpos + 1, None
        extpos += 1
        if 0x41 <= char <= 0x5A: # A-Z
            digit = char - 0x41
        elif 0x30 <= char <= 0x39:

            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 200 Column: 22

              
class Codec(codecs.Codec):

    def encode(self, input, errors='strict'):
        res = punycode_encode(input)
        return res, len(input)

    def decode(self, input, errors='strict'):
        if errors not in ('strict', 'replace', 'ignore'):

            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 204 Column: 22

                      res = punycode_encode(input)
        return res, len(input)

    def decode(self, input, errors='strict'):
        if errors not in ('strict', 'replace', 'ignore'):
            raise UnicodeError("Unsupported error handling "+errors)
        res = punycode_decode(input, errors)
        return res, len(input)


            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 211 Column: 22

                      return res, len(input)

class IncrementalEncoder(codecs.IncrementalEncoder):
    def encode(self, input, final=False):
        return punycode_encode(input)

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        if self.errors not in ('strict', 'replace', 'ignore'):

            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 215 Column: 22

                      return punycode_encode(input)

class IncrementalDecoder(codecs.IncrementalDecoder):
    def decode(self, input, final=False):
        if self.errors not in ('strict', 'replace', 'ignore'):
            raise UnicodeError("Unsupported error handling "+self.errors)
        return punycode_decode(input, self.errors)

class StreamWriter(Codec,codecs.StreamWriter):

            

Reported by Pylint.

Lib/idlelib/percolator.py
36 issues
XXX would be nice to inherit from Delegator
Error

Line: 8 Column: 3

              class Percolator:

    def __init__(self, text):
        # XXX would be nice to inherit from Delegator
        self.text = text
        self.redir = WidgetRedirector(text)
        self.top = self.bottom = Delegator(text)
        self.bottom.insert = self.redir.register("insert", self.insert)
        self.bottom.delete = self.redir.register("delete", self.delete)

            

Reported by Pylint.

Redefining built-in 'filter'
Error

Line: 34 Column: 28

                      # Could go away if inheriting from Delegator
        self.top.delete(index1, index2)

    def insertfilter(self, filter):
        # Perhaps rename to pushfilter()?
        assert isinstance(filter, Delegator)
        assert filter.delegate is None
        filter.setdelegate(self.top)
        self.top = filter

            

Reported by Pylint.

Redefining built-in 'filter'
Error

Line: 41 Column: 33

                      filter.setdelegate(self.top)
        self.top = filter

    def insertfilterafter(self, filter, after):
        assert isinstance(filter, Delegator)
        assert isinstance(after, Delegator)
        assert filter.delegate is None

        f = self.top

            

Reported by Pylint.

Redefining built-in 'filter'
Error

Line: 56 Column: 28

                      filter.setdelegate(f.delegate)
        f.setdelegate(filter)

    def removefilter(self, filter):
        # XXX Perhaps should only support popfilter()?
        assert isinstance(filter, Delegator)
        assert filter.delegate is not None
        f = self.top
        if f is filter:

            

Reported by Pylint.

XXX Perhaps should only support popfilter()?
Error

Line: 57 Column: 3

                      f.setdelegate(filter)

    def removefilter(self, filter):
        # XXX Perhaps should only support popfilter()?
        assert isinstance(filter, Delegator)
        assert filter.delegate is not None
        f = self.top
        if f is filter:
            self.top = filter.delegate

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from idlelib.delegator import Delegator
from idlelib.redirector import WidgetRedirector


class Percolator:

    def __init__(self, text):
        # XXX would be nice to inherit from Delegator
        self.text = text

            

Reported by Pylint.

Missing class docstring
Error

Line: 5 Column: 1

              from idlelib.redirector import WidgetRedirector


class Percolator:

    def __init__(self, text):
        # XXX would be nice to inherit from Delegator
        self.text = text
        self.redir = WidgetRedirector(text)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 16 Column: 5

                      self.bottom.delete = self.redir.register("delete", self.delete)
        self.filters = []

    def close(self):
        while self.top is not self.bottom:
            self.removefilter(self.top)
        self.top = None
        self.bottom.setdelegate(None)
        self.bottom = None

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 26 Column: 5

                      self.redir = None
        self.text = None

    def insert(self, index, chars, tags=None):
        # Could go away if inheriting from Delegator
        self.top.insert(index, chars, tags)

    def delete(self, index1, index2=None):
        # Could go away if inheriting from Delegator

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 30 Column: 5

                      # Could go away if inheriting from Delegator
        self.top.insert(index, chars, tags)

    def delete(self, index1, index2=None):
        # Could go away if inheriting from Delegator
        self.top.delete(index1, index2)

    def insertfilter(self, filter):
        # Perhaps rename to pushfilter()?

            

Reported by Pylint.

Lib/ctypes/macholib/dyld.py
35 issues
Unused import cycle from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import filterfalse from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import groupby from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import islice from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import combinations from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import permutations from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Wildcard import itertools
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import product from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import repeat from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Unused import starmap from wildcard import
Error

Line: 8 Column: 1

              import os
from ctypes.macholib.framework import framework_info
from ctypes.macholib.dylib import dylib_info
from itertools import *
try:
    from _ctypes import _dyld_shared_cache_contains_path
except ImportError:
    def _dyld_shared_cache_contains_path(*args):
        raise NotImplementedError

            

Reported by Pylint.

Lib/distutils/unixccompiler.py
35 issues
Instance of 'UnixCCompiler' has no 'preprocessor' member
Error

Line: 90 Column: 19

                      fixed_args = self._fix_compile_args(None, macros, include_dirs)
        ignore, macros, include_dirs = fixed_args
        pp_opts = gen_preprocess_options(macros, include_dirs)
        pp_args = self.preprocessor + pp_opts
        if output_file:
            pp_args.extend(['-o', output_file])
        if extra_preargs:
            pp_args[:0] = extra_preargs
        if extra_postargs:

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'compiler_so' member
Error

Line: 112 Column: 23

                              raise CompileError(msg)

    def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
        compiler_so = self.compiler_so
        if sys.platform == 'darwin':
            compiler_so = _osx_support.compiler_fixup(compiler_so,
                                                    cc_args + extra_postargs)
        try:
            self.spawn(compiler_so + cc_args + [src, '-o', obj] +

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'archiver' member
Error

Line: 131 Column: 24

              
        if self._need_link(objects, output_filename):
            self.mkpath(os.path.dirname(output_filename))
            self.spawn(self.archiver +
                       [output_filename] +
                       objects + self.objects)

            # Not many Unices required ranlib anymore -- SunOS 4.x is, I
            # think the only major Unix that does.  Maybe we need some

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'ranlib' member
Error

Line: 140 Column: 16

                          # platform intelligence here to skip ranlib if it's not
            # needed -- or maybe Python's configure script took care of
            # it for us, hence the check for leading colon.
            if self.ranlib:
                try:
                    self.spawn(self.ranlib + [output_filename])
                except DistutilsExecError as msg:
                    raise LibError(msg)
        else:

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'ranlib' member
Error

Line: 142 Column: 32

                          # it for us, hence the check for leading colon.
            if self.ranlib:
                try:
                    self.spawn(self.ranlib + [output_filename])
                except DistutilsExecError as msg:
                    raise LibError(msg)
        else:
            log.debug("skipping %s (up-to-date)", output_filename)


            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'linker_exe' member
Error

Line: 177 Column: 30

                          self.mkpath(os.path.dirname(output_filename))
            try:
                if target_desc == CCompiler.EXECUTABLE:
                    linker = self.linker_exe[:]
                else:
                    linker = self.linker_so[:]
                if target_lang == "c++" and self.compiler_cxx:
                    # skip over environment variable settings if /usr/bin/env
                    # is used to set up the linker's environment.

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'linker_so' member
Error

Line: 179 Column: 30

                              if target_desc == CCompiler.EXECUTABLE:
                    linker = self.linker_exe[:]
                else:
                    linker = self.linker_so[:]
                if target_lang == "c++" and self.compiler_cxx:
                    # skip over environment variable settings if /usr/bin/env
                    # is used to set up the linker's environment.
                    # This is needed on OSX. Note: this assumes that the
                    # normal and C++ compiler have the same environment

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'compiler_cxx' member
Error

Line: 180 Column: 45

                                  linker = self.linker_exe[:]
                else:
                    linker = self.linker_so[:]
                if target_lang == "c++" and self.compiler_cxx:
                    # skip over environment variable settings if /usr/bin/env
                    # is used to set up the linker's environment.
                    # This is needed on OSX. Note: this assumes that the
                    # normal and C++ compiler have the same environment
                    # settings.

            

Reported by Pylint.

Instance of 'UnixCCompiler' has no 'compiler_cxx' member
Error

Line: 199 Column: 40

                                  else:
                        offset = 0

                    linker[i+offset] = self.compiler_cxx[i]

                if sys.platform == 'darwin':
                    linker = _osx_support.compiler_fixup(linker, ld_args)

                self.spawn(linker + ld_args)

            

Reported by Pylint.

XXX Things not currently handled:
Error

Line: 29 Column: 3

              if sys.platform == 'darwin':
    import _osx_support

# XXX Things not currently handled:
#   * optimization/debug/warning flags; we just use whatever's in Python's
#     Makefile and live with it.  Is this adequate?  If not, we might
#     have to have a bunch of subclasses GNUCCompiler, SGICCompiler,
#     SunCCompiler, and I suspect down that road lies madness.
#   * even if we don't know a warning flag from an optimization flag,

            

Reported by Pylint.

Lib/json/encoder.py
35 issues
An attribute defined in encoder line 158 hides this method
Error

Line: 160 Column: 5

                      if default is not None:
            self.default = default

    def default(self, o):
        """Implement this method in a subclass such that it returns
        a serializable object for ``o``, or calls the base implementation
        (to raise a ``TypeError``).

        For example, to support arbitrary iterators, you could

            

Reported by Pylint.

Redefining built-in 'ValueError'
Error

Line: 262 Column: 9

              def _make_iterencode(markers, _default, _encoder, _indent, _floatstr,
        _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot,
        ## HACK: hand-optimized bytecode; turn globals into locals
        ValueError=ValueError,
        dict=dict,
        float=float,
        id=id,
        int=int,
        isinstance=isinstance,

            

Reported by Pylint.

Redefining built-in 'dict'
Error

Line: 263 Column: 9

                      _key_separator, _item_separator, _sort_keys, _skipkeys, _one_shot,
        ## HACK: hand-optimized bytecode; turn globals into locals
        ValueError=ValueError,
        dict=dict,
        float=float,
        id=id,
        int=int,
        isinstance=isinstance,
        list=list,

            

Reported by Pylint.

Redefining built-in 'float'
Error

Line: 264 Column: 9

                      ## HACK: hand-optimized bytecode; turn globals into locals
        ValueError=ValueError,
        dict=dict,
        float=float,
        id=id,
        int=int,
        isinstance=isinstance,
        list=list,
        str=str,

            

Reported by Pylint.

Redefining built-in 'id'
Error

Line: 265 Column: 9

                      ValueError=ValueError,
        dict=dict,
        float=float,
        id=id,
        int=int,
        isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,

            

Reported by Pylint.

Redefining built-in 'int'
Error

Line: 266 Column: 9

                      dict=dict,
        float=float,
        id=id,
        int=int,
        isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,
        _intstr=int.__repr__,

            

Reported by Pylint.

Redefining built-in 'isinstance'
Error

Line: 267 Column: 9

                      float=float,
        id=id,
        int=int,
        isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,
        _intstr=int.__repr__,
    ):

            

Reported by Pylint.

Redefining built-in 'list'
Error

Line: 268 Column: 9

                      id=id,
        int=int,
        isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,
        _intstr=int.__repr__,
    ):


            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 269 Column: 9

                      int=int,
        isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,
        _intstr=int.__repr__,
    ):

    if _indent is not None and not isinstance(_indent, str):

            

Reported by Pylint.

Redefining built-in 'tuple'
Error

Line: 270 Column: 9

                      isinstance=isinstance,
        list=list,
        str=str,
        tuple=tuple,
        _intstr=int.__repr__,
    ):

    if _indent is not None and not isinstance(_indent, str):
        _indent = ' ' * _indent

            

Reported by Pylint.