The following issues were found

src/third_party/wiredtiger/src/docs/tools/doxypy.py
285 issues
Uses of a deprecated module 'optparse'
Error

Line: 47 Column: 1

              import sys
import re

from optparse import OptionParser, OptionGroup

class FSM(object):
	"""Implements a finite state machine.
	
	Transitions are given as 4-tuples, consisting of an origin state, a target

            

Reported by Pylint.

Unused OptionGroup imported from optparse
Error

Line: 47 Column: 1

              import sys
import re

from optparse import OptionParser, OptionGroup

class FSM(object):
	"""Implements a finite state machine.
	
	Transitions are given as 4-tuples, consisting of an origin state, a target

            

Reported by Pylint.

String statement has no effect
Error

Line: 58 Column: 2

              	to be called upon the execution of the given transition. 
	"""

	"""
	@var transitions holds the transitions
	@var current_state holds the current state
	@var current_input holds the current input
	@var current_transition hold the currently active transition
	"""

            

Reported by Pylint.

Dangerous default value [] as argument
Error

Line: 65 Column: 2

              	@var current_transition hold the currently active transition
	"""

	def __init__(self, start_state=None, transitions=[]):
		self.transitions = transitions
		self.current_state = start_state
		self.current_input = None
		self.current_transition = None


            

Reported by Pylint.

Redefining built-in 'input'
Error

Line: 77 Column: 27

              	def addTransition(self, from_state, to_state, condition, callback):
		self.transitions.append([from_state, to_state, condition, callback])

	def makeTransition(self, input):
		"""Makes a transition based on the given input.
		
		@param	input	input to parse by the FSM
		"""
		for transition in self.transitions:

            

Reported by Pylint.

Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
Error

Line: 99 Column: 47

              	def __init__(self):
		string_prefixes = "[uU]?[rR]?"

		self.start_single_comment_re = re.compile("^\s*%s(''')" % string_prefixes)
		self.end_single_comment_re = re.compile("(''')\s*$")

		self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes)
		self.end_double_comment_re = re.compile("(\"\"\")\s*$")


            

Reported by Pylint.

Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
Error

Line: 100 Column: 49

              		string_prefixes = "[uU]?[rR]?"

		self.start_single_comment_re = re.compile("^\s*%s(''')" % string_prefixes)
		self.end_single_comment_re = re.compile("(''')\s*$")

		self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes)
		self.end_double_comment_re = re.compile("(\"\"\")\s*$")

		self.single_comment_re = re.compile("^\s*%s(''').*(''')\s*$" % string_prefixes)

            

Reported by Pylint.

Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
Error

Line: 102 Column: 47

              		self.start_single_comment_re = re.compile("^\s*%s(''')" % string_prefixes)
		self.end_single_comment_re = re.compile("(''')\s*$")

		self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes)
		self.end_double_comment_re = re.compile("(\"\"\")\s*$")

		self.single_comment_re = re.compile("^\s*%s(''').*(''')\s*$" % string_prefixes)
		self.double_comment_re = re.compile("^\s*%s(\"\"\").*(\"\"\")\s*$" % string_prefixes)


            

Reported by Pylint.

Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
Error

Line: 103 Column: 52

              		self.end_single_comment_re = re.compile("(''')\s*$")

		self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes)
		self.end_double_comment_re = re.compile("(\"\"\")\s*$")

		self.single_comment_re = re.compile("^\s*%s(''').*(''')\s*$" % string_prefixes)
		self.double_comment_re = re.compile("^\s*%s(\"\"\").*(\"\"\")\s*$" % string_prefixes)

		self.defclass_re = re.compile("^(\s*)(def .+:|class .+:)")

            

Reported by Pylint.

Anomalous backslash in string: '\s'. String constant might be missing an r prefix.
Error

Line: 105 Column: 58

              		self.start_double_comment_re = re.compile("^\s*%s(\"\"\")" % string_prefixes)
		self.end_double_comment_re = re.compile("(\"\"\")\s*$")

		self.single_comment_re = re.compile("^\s*%s(''').*(''')\s*$" % string_prefixes)
		self.double_comment_re = re.compile("^\s*%s(\"\"\").*(\"\"\")\s*$" % string_prefixes)

		self.defclass_re = re.compile("^(\s*)(def .+:|class .+:)")
		self.empty_re = re.compile("^\s*$")
		self.hashline_re = re.compile("^\s*#.*$")

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Util.py
269 issues
Starting a process with a shell, possible injection detected, security issue.
Security injection

Line: 1005
Suggestion: https://bandit.readthedocs.io/en/latest/plugins/b605_start_process_with_a_shell.html

                  def get_native_path(path):
        """Transforms an absolute path into a native path for the system.  In
        Cygwin, this converts from a Cygwin path to a Windows one."""
        with os.popen('cygpath -w ' + path) as p:
            npath = p.read().replace('\n', '')
        return npath
else:
    def get_native_path(path):
        """Transforms an absolute path into a native path for the system.

            

Reported by Bandit.

function already defined line 636
Error

Line: 716 Column: 5

                  def RegGetValue(root, key):
        raise WinError

    def RegOpenKeyEx(root, key):
        raise WinError

if sys.platform == 'win32':

    def WhereIs(file, path=None, pathext=None, reject=[]):

            

Reported by Pylint.

Unused import codecs
Error

Line: 34 Column: 1

              import copy
import re
import types
import codecs
import pprint
import hashlib

PY3 = sys.version_info[0] == 3


            

Reported by Pylint.

Unused Iterable imported from collections.abc
Error

Line: 48 Column: 5

                  from UserString import UserString

try:
    from collections.abc import Iterable, MappingView
except ImportError:
    from collections import Iterable

from collections import OrderedDict


            

Reported by Pylint.

Dangerous default value {} as argument
Error

Line: 70 Column: 1

              else:
    UnicodeType = unicode

def dictify(keys, values, result={}):
    for k, v in zip(keys, values):
        result[k] = v
    return result

_altsep = os.altsep

            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 88 Column: 17

              
# First two from the Python Cookbook, just for completeness.
# (Yeah, yeah, YAGNI...)
def containsAny(str, set):
    """Check whether sequence str contains ANY of the items in set."""
    for c in set:
        if c in str: return 1
    return 0


            

Reported by Pylint.

Redefining built-in 'set'
Error

Line: 88 Column: 22

              
# First two from the Python Cookbook, just for completeness.
# (Yeah, yeah, YAGNI...)
def containsAny(str, set):
    """Check whether sequence str contains ANY of the items in set."""
    for c in set:
        if c in str: return 1
    return 0


            

Reported by Pylint.

Redefining built-in 'set'
Error

Line: 94 Column: 22

                      if c in str: return 1
    return 0

def containsAll(str, set):
    """Check whether sequence str contains ALL of the items in set."""
    for c in set:
        if c not in str: return 0
    return 1


            

Reported by Pylint.

Redefining built-in 'str'
Error

Line: 94 Column: 17

                      if c in str: return 1
    return 0

def containsAll(str, set):
    """Check whether sequence str contains ALL of the items in set."""
    for c in set:
        if c not in str: return 0
    return 1


            

Reported by Pylint.

Redefining built-in 'set'
Error

Line: 100 Column: 23

                      if c not in str: return 0
    return 1

def containsOnly(str, set):
    """Check whether sequence str contains ONLY items in set."""
    for c in str:
        if c not in set: return 0
    return 1


            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/tests/test_test_protocol.py
261 issues
Unable to import 'testtools'
Error

Line: 21 Column: 1

              import unittest
import os

from testtools import PlaceHolder, skipIf, TestCase, TestResult
from testtools.compat import _b, _u, BytesIO
from testtools.content import Content, TracebackContent, text_content
from testtools.content_type import ContentType
try:
    from testtools.testresult.doubles import (

            

Reported by Pylint.

Unable to import 'testtools.compat'
Error

Line: 22 Column: 1

              import os

from testtools import PlaceHolder, skipIf, TestCase, TestResult
from testtools.compat import _b, _u, BytesIO
from testtools.content import Content, TracebackContent, text_content
from testtools.content_type import ContentType
try:
    from testtools.testresult.doubles import (
        Python26TestResult,

            

Reported by Pylint.

Unable to import 'testtools.content'
Error

Line: 23 Column: 1

              
from testtools import PlaceHolder, skipIf, TestCase, TestResult
from testtools.compat import _b, _u, BytesIO
from testtools.content import Content, TracebackContent, text_content
from testtools.content_type import ContentType
try:
    from testtools.testresult.doubles import (
        Python26TestResult,
        Python27TestResult,

            

Reported by Pylint.

Unable to import 'testtools.content_type'
Error

Line: 24 Column: 1

              from testtools import PlaceHolder, skipIf, TestCase, TestResult
from testtools.compat import _b, _u, BytesIO
from testtools.content import Content, TracebackContent, text_content
from testtools.content_type import ContentType
try:
    from testtools.testresult.doubles import (
        Python26TestResult,
        Python27TestResult,
        ExtendedTestResult,

            

Reported by Pylint.

Unable to import 'testtools.matchers'
Error

Line: 37 Column: 1

                      Python27TestResult,
        ExtendedTestResult,
        )
from testtools.matchers import Contains

import subunit
from subunit.tests import (
    _remote_exception_repr,
    _remote_exception_str,

            

Reported by Pylint.

Instance of '_OutSideTest' has no '_outcome' member
Error

Line: 406 Column: 9

              
    def test__outcome_sets_details_parser(self):
        self.protocol._reading_success_details.details_parser = None
        self.protocol._state._outcome(0, _b("mcdonalds farm [ multipart\n"),
            None, self.protocol._reading_success_details)
        parser = self.protocol._reading_success_details.details_parser
        self.assertNotEqual(None, parser)
        self.assertTrue(isinstance(parser,
            subunit.details.MultipartDetailsParser))

            

Reported by Pylint.

Instance of 'TestTestProtocolServerAddxFail' has no '_events' member
Error

Line: 527 Column: 9

                  """

    def capture_expected_failure(self, test, err):
        self._events.append((test, err))

    def setup_python26(self):
        """Setup a test object ready to be xfailed and thunk to success."""
        self.client = Python26TestResult()
        self.setup_protocol()

            

Reported by Pylint.

Access to a protected member _err_details_to_string of a client class
Error

Line: 49 Column: 12

              

def details_to_str(details):
    return TestResult()._err_details_to_string(None, details=details)


class TestTestImports(unittest.TestCase):

    def test_imports(self):

            

Reported by Pylint.

Unused DiscardStream imported from subunit
Error

Line: 55 Column: 9

              class TestTestImports(unittest.TestCase):

    def test_imports(self):
        from subunit import DiscardStream
        from subunit import TestProtocolServer
        from subunit import RemotedTestCase
        from subunit import RemoteError
        from subunit import ExecTestCase
        from subunit import IsolatedTestCase

            

Reported by Pylint.

Unused TestProtocolServer imported from subunit
Error

Line: 56 Column: 9

              
    def test_imports(self):
        from subunit import DiscardStream
        from subunit import TestProtocolServer
        from subunit import RemotedTestCase
        from subunit import RemoteError
        from subunit import ExecTestCase
        from subunit import IsolatedTestCase
        from subunit import TestProtocolClient

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/testtools-0.9.34/testtools/testresult/real.py
258 issues
Unable to import 'extras'
Error

Line: 30 Column: 1

              import sys
import unittest

from extras import safe_hasattr, try_import, try_imports
parse_mime_type = try_import('mimeparse.parse_mime_type')
Queue = try_imports(['Queue.Queue', 'queue.Queue'])

from testtools.compat import all, str_is_unicode, _u, _b
from testtools.content import (

            

Reported by Pylint.

method already defined line 1319
Error

Line: 1381 Column: 5

                      self.__now = None
        self._started = True

    def stopTest(self, test):
        self._tags = self._tags.parent

    @property
    def current_tags(self):
        """The currently set tags."""

            

Reported by Pylint.

Undefined variable 'unicode'
Error

Line: 1704 Column: 36

              
    if not str_is_unicode:
        def __init__(self, string):
            if type(string) is not unicode:
                raise TypeError("_StringException expects unicode, got %r" %
                    (string,))
            Exception.__init__(self, string)

        def __str__(self):

            

Reported by Pylint.

__str__ does not return str
Error

Line: 1709 Column: 9

                                  (string,))
            Exception.__init__(self, string)

        def __str__(self):
            return self.args[0].encode("utf-8")

        def __unicode__(self):
            return self.args[0]
    # For 3.0 and above the default __str__ is fine, so we don't define one.

            

Reported by Pylint.

Redefining built-in 'all'
Error

Line: 34 Column: 1

              parse_mime_type = try_import('mimeparse.parse_mime_type')
Queue = try_imports(['Queue.Queue', 'queue.Queue'])

from testtools.compat import all, str_is_unicode, _u, _b
from testtools.content import (
    Content,
    text_content,
    TracebackContent,
    )

            

Reported by Pylint.

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

Line: 83 Column: 5

                  :ivar skip_reasons: A dict of skip-reasons -> list of tests. See addSkip.
    """

    def __init__(self, failfast=False):
        # startTestRun resets all attributes, and older clients don't know to
        # call startTestRun, so it is called once here.
        # Because subclasses may reasonably not expect this, we call the
        # specific version we want to run.
        self.failfast = failfast

            

Reported by Pylint.

Parameters differ from overridden 'addExpectedFailure' method
Error

Line: 91 Column: 5

                      self.failfast = failfast
        TestResult.startTestRun(self)

    def addExpectedFailure(self, test, err=None, details=None):
        """Called when a test has failed in an expected manner.

        Like with addSuccess and addError, testStopped should still be called.

        :param test: The test that has been skipped.

            

Reported by Pylint.

Parameters differ from overridden 'addError' method
Error

Line: 104 Column: 5

                      self.expectedFailures.append(
            (test, self._err_details_to_string(test, err, details)))

    def addError(self, test, err=None, details=None):
        """Called when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().

        :param details: Alternative way to supply details about the outcome.
            see the class docstring for more information.

            

Reported by Pylint.

Parameters differ from overridden 'addFailure' method
Error

Line: 116 Column: 5

                      if self.failfast:
            self.stop()

    def addFailure(self, test, err=None, details=None):
        """Called when an error has occurred. 'err' is a tuple of values as
        returned by sys.exc_info().

        :param details: Alternative way to supply details about the outcome.
            see the class docstring for more information.

            

Reported by Pylint.

Parameters differ from overridden 'addSkip' method
Error

Line: 128 Column: 5

                      if self.failfast:
            self.stop()

    def addSkip(self, test, reason=None, details=None):
        """Called when a test has been skipped rather than running.

        Like with addSuccess and addError, testStopped should still be called.

        This must be called by the TestCase. 'addError' and 'addFailure' will

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/SConf.py
236 issues
The raise statement is not inside an except clause
Error

Line: 254 Column: 13

                      exc_type = self.exc_info()[0]
        if issubclass(exc_type, SConfError):
            # TODO pylint E0704: bare raise not inside except
            raise
        elif issubclass(exc_type, SCons.Errors.BuildError):
            # we ignore Build Errors (occurs, when a test doesn't pass)
            # Clear the exception to prevent the contained traceback
            # to build a reference cycle.
            self.exc_clear()

            

Reported by Pylint.

Redefining built-in 'type'
Error

Line: 69 Column: 18

              build_type = None
build_types = ['clean', 'help']

def SetBuildType(type):
    global build_type
    build_type = type

# to be set, if we are in dry-run mode
dryrun = 0

            

Reported by Pylint.

Using the global statement
Error

Line: 70 Column: 5

              build_types = ['clean', 'help']

def SetBuildType(type):
    global build_type
    build_type = type

# to be set, if we are in dry-run mode
dryrun = 0


            

Reported by Pylint.

Using the global statement
Error

Line: 84 Column: 5

              def SetCacheMode(mode):
    """Set the Configure cache mode. mode must be one of "auto", "force",
    or "cache"."""
    global cache_mode
    if mode == "auto":
        cache_mode = AUTO
    elif mode == "force":
        cache_mode = FORCE
    elif mode == "cache":

            

Reported by Pylint.

Using the global statement
Error

Line: 97 Column: 5

              progress_display = SCons.Util.display # will be overwritten by SCons.Script
def SetProgressDisplay(display):
    """Set the progress display to use (called from SCons.Script)"""
    global progress_display
    progress_display = display

SConfFS = None

_ac_build_counter = defaultdict(int)

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 107 Column: 36

              _ac_config_hs   = {}  # all config.h files created in this build
sconf_global = None   # current sconf object

def _createConfigH(target, source, env):
    t = open(str(target[0]), "w")
    defname = re.sub('[^A-Za-z0-9_]', '_', str(target[0]).upper())
    t.write("""#ifndef %(DEFNAME)s_SEEN
#define %(DEFNAME)s_SEEN


            

Reported by Pylint.

Unused argument 'source'
Error

Line: 120 Column: 28

              """ % {'DEFNAME' : defname})
    t.close()

def _stringConfigH(target, source, env):
    return "scons: Configure: creating " + str(target[0])


def NeedConfigHBuilder():
    if len(_ac_config_hs) == 0:

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 120 Column: 36

              """ % {'DEFNAME' : defname})
    t.close()

def _stringConfigH(target, source, env):
    return "scons: Configure: creating " + str(target[0])


def NeedConfigHBuilder():
    if len(_ac_config_hs) == 0:

            

Reported by Pylint.

Unused argument 'env'
Error

Line: 167 Column: 35

              

# define actions for building text files
def _createSource(target, source, env):
    fd = open(str(target[0]), "w")
    fd.write(source[0].get_contents().decode())
    fd.close()



            

Reported by Pylint.

Unused argument 'env'
Error

Line: 173 Column: 36

                  fd.close()


def _stringSource( target, source, env ):
    return (str(target[0]) + ' <-\n  |' +
            source[0].get_contents().decode().replace( '\n', "\n  |" ) )

class SConfBuildInfo(SCons.Node.FS.FileBuildInfo):
    """

            

Reported by Pylint.

src/third_party/wiredtiger/dist/stat_data.py
235 issues
Undefined variable 'cmp'
Error

Line: 32 Column: 16

                      self.flags = flags

    def __cmp__(self, other):
        return cmp(self.desc.lower(), other.desc.lower())

class BlockStat(Stat):
    prefix = 'block-manager'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BlockStat.prefix, desc, flags)

            

Reported by Pylint.

Unused import sys
Error

Line: 23 Column: 1

              # are maintained over time are normally not scaled per second).

from operator import attrgetter
import sys

class Stat:
    def __init__(self, name, tag, desc, flags=''):
        self.name = name
        self.desc = tag + ': ' + desc

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              # Auto-generate statistics #defines, with initialization, clear and aggregate
# functions.
#
# NOTE: Statistics reports show individual objects as operations per second.
# All objects where that does not make sense should have the word 'currently'
# or the phrase 'in the cache' in their text description, for example, 'files
# currently open'.
# NOTE: All statistics descriptions must have a prefix string followed by ':'.
#

            

Reported by Pylint.

Missing class docstring
Error

Line: 25 Column: 1

              from operator import attrgetter
import sys

class Stat:
    def __init__(self, name, tag, desc, flags=''):
        self.name = name
        self.desc = tag + ': ' + desc
        self.flags = flags


            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 25 Column: 1

              from operator import attrgetter
import sys

class Stat:
    def __init__(self, name, tag, desc, flags=''):
        self.name = name
        self.desc = tag + ': ' + desc
        self.flags = flags


            

Reported by Pylint.

Missing class docstring
Error

Line: 34 Column: 1

                  def __cmp__(self, other):
        return cmp(self.desc.lower(), other.desc.lower())

class BlockStat(Stat):
    prefix = 'block-manager'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BlockStat.prefix, desc, flags)
class BtreeStat(Stat):
    prefix = 'btree'

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 34 Column: 1

                  def __cmp__(self, other):
        return cmp(self.desc.lower(), other.desc.lower())

class BlockStat(Stat):
    prefix = 'block-manager'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BlockStat.prefix, desc, flags)
class BtreeStat(Stat):
    prefix = 'btree'

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 38 Column: 1

                  prefix = 'block-manager'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BlockStat.prefix, desc, flags)
class BtreeStat(Stat):
    prefix = 'btree'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BtreeStat.prefix, desc, flags)
class CacheStat(Stat):
    prefix = 'cache'

            

Reported by Pylint.

Missing class docstring
Error

Line: 38 Column: 1

                  prefix = 'block-manager'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BlockStat.prefix, desc, flags)
class BtreeStat(Stat):
    prefix = 'btree'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BtreeStat.prefix, desc, flags)
class CacheStat(Stat):
    prefix = 'cache'

            

Reported by Pylint.

Too few public methods (0/2)
Error

Line: 42 Column: 1

                  prefix = 'btree'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, BtreeStat.prefix, desc, flags)
class CacheStat(Stat):
    prefix = 'cache'
    def __init__(self, name, desc, flags=''):
        Stat.__init__(self, name, CacheStat.prefix, desc, flags)
class CacheWalkStat(Stat):
    prefix = 'cache_walk'

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Action.py
232 issues
Instance of 'ActionBase' has no 'get_presig' member
Error

Line: 534 Column: 18

                      return str(self)

    def get_contents(self, target, source, env):
        result = self.get_presig(target, source, env)

        if not isinstance(result,(bytes, bytearray)):
            result = bytearray(result, 'utf-8')
        else:
            # Make a copy and put in bytearray, without this the contents returned by get_presig

            

Reported by Pylint.

Instance of 'ActionBase' has no 'varlist' member
Error

Line: 585 Column: 16

                      return lines

    def get_varlist(self, target, source, env, executor=None):
        return self.varlist

    def get_targets(self, env, executor):
        """
        Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used
        by this action.

            

Reported by Pylint.

Instance of 'ActionBase' has no 'targets' member
Error

Line: 592 Column: 16

                      Returns the type of targets ($TARGETS, $CHANGED_TARGETS) used
        by this action.
        """
        return self.targets


class _ActionAction(ActionBase):
    """Base class for actions that create output objects."""
    def __init__(self, cmdstr=_null, strfunction=_null, varlist=(),

            

Reported by Pylint.

Instance of '_ActionAction' has no 'execute' member
Error

Line: 708 Column: 24

                          if chdir:
                os.chdir(chdir)
            try:
                stat = self.execute(target, source, env, executor=executor)
                if isinstance(stat, SCons.Errors.BuildError):
                    s = exitstatfunc(stat.status)
                    if s:
                        stat.status = s
                    else:

            

Reported by Pylint.

An attribute defined in Action line 606 hides this method
Error

Line: 882 Column: 5

                          pass
        return result, ignore, silent

    def strfunction(self, target, source, env, executor=None):
        if self.cmdstr is None:
            return None
        if self.cmdstr is not _null:
            from SCons.Subst import SUBST_RAW
            if executor:

            

Reported by Pylint.

An attribute defined in Action line 606 hides this method
Error

Line: 1159 Column: 5

                          except AttributeError:
                return "unknown_python_function"

    def strfunction(self, target, source, env, executor=None):
        if self.cmdstr is None:
            return None
        if self.cmdstr is not _null:
            from SCons.Subst import SUBST_RAW
            if executor:

            

Reported by Pylint.

Unused import itertools
Error

Line: 108 Column: 1

              import re
import sys
import subprocess
import itertools
import inspect
from collections import OrderedDict

import SCons.Debug
from SCons.Debug import logInstanceCreation

            

Reported by Pylint.

TODO: We can roll this forward to 2 (if it has value), but not
Error

Line: 132 Column: 3

              # otherwise python3 and python2 will yield different pickles
# for the same object.
# This is due to default being 1 for python 2.7, and 3 for 3.x
# TODO: We can roll this forward to 2 (if it has value), but not
# before a deprecation cycle as the sconsigns will change
ACTION_SIGNATURE_PICKLE_PROTOCOL = 1


def rfile(n):

            

Reported by Pylint.

Unused variable 'ae'
Error

Line: 197 Column: 17

                                  # Test if obj is a function object.
                    return _function_contents(obj)

                except AttributeError as ae:
                    # Should be a pickle-able Python object.
                    try:
                        return _object_instance_content(obj)
                        # pickling an Action instance or object doesn't yield a stable
                        # content as instance property may be dumped in different orders

            

Reported by Pylint.

Unused variable 'ex'
Error

Line: 204 Column: 21

                                      # pickling an Action instance or object doesn't yield a stable
                        # content as instance property may be dumped in different orders
                        # return pickle.dumps(obj, ACTION_SIGNATURE_PICKLE_PROTOCOL)
                    except (pickle.PicklingError, TypeError, AttributeError) as ex:
                        # This is weird, but it seems that nested classes
                        # are unpickable. The Python docs say it should
                        # always be a PicklingError, but some Python
                        # versions seem to return TypeError.  Just do
                        # the best we can.

            

Reported by Pylint.

src/third_party/wiredtiger/tools/optrack/wt_optrack_decode.py
231 issues
The raise statement is not inside an except clause
Error

Line: 157 Column: 9

                  if (len(bytesRead) < MIN_HEADER_SIZE):
        print(color.BOLD + color.RED +
              "unexpected sized input file" + color.END);
        raise;

    version, threadType, tsc_nsec = struct.unpack('=III', bytesRead);
    print("VERSION IS " + str(version));

    # If the version number is 2, the header contains three fields:

            

Reported by Pylint.

Undefined variable 'unknown'
Error

Line: 191 Column: 16

                  elif (threadType == 1):
        return "internal";
    else:
        return unknown;


def parseFile(fileName):

    done = False;

            

Reported by Pylint.

Undefined variable 'outputfileName'
Error

Line: 241 Column: 40

                      outputFile = open(outputFileName, "w");
    except:
        print(color.BOLD + color.RED +
              "Could not open file " + outputfileName + ".txt for writing." +
              color.END);
        return;

    print(color.BOLD + color.PURPLE +
          "Writing to output file " + outputFileName + "." + color.END);

            

Reported by Pylint.

Unused import colorsys
Error

Line: 30 Column: 1

              # OTHER DEALINGS IN THE SOFTWARE.

import argparse
import colorsys
from multiprocessing import Process
import multiprocessing
import os
import os.path
import struct

            

Reported by Pylint.

Unused import subprocess
Error

Line: 37 Column: 1

              import os.path
import struct
import sys
import subprocess
import time
import traceback

#
# This log version must be the same as that defined in ../src/include/optrack.h

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 44 Column: 1

              #
# This log version must be the same as that defined in ../src/include/optrack.h
#
currentLogVersion = 2;

class color:
   PURPLE = '\033[95m'
   CYAN = '\033[96m'
   DARKCYAN = '\033[36m'

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 58 Column: 1

                 UNDERLINE = '\033[4m'
   END = '\033[0m'

functionMap = {};

def buildTranslationMap(mapFileName):

    mapFile = None;


            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 62 Column: 1

              
def buildTranslationMap(mapFileName):

    mapFile = None;

    if not os.path.exists(mapFileName):
        return False;

    try:

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 65 Column: 1

                  mapFile = None;

    if not os.path.exists(mapFileName):
        return False;

    try:
        mapFile = open(mapFileName, "r");
    except:
        print(color.BOLD + color.RED);

            

Reported by Pylint.

Unnecessary semicolon
Error

Line: 68 Column: 1

                      return False;

    try:
        mapFile = open(mapFileName, "r");
    except:
        print(color.BOLD + color.RED);
        print("Could not open " + mapFileName + " for reading");
        print(color.END);
        raise;

            

Reported by Pylint.

src/third_party/scons-3.1.2/scons-local-3.1.2/SCons/Node/__init__.py
224 issues
Assigning result of a function call, where the function returns None
Error

Line: 1074 Column: 13

              
        # Here's where we implement --implicit-cache.
        if implicit_cache and not implicit_deps_changed:
            implicit = self.get_stored_implicit()
            if implicit is not None:
                # We now add the implicit dependencies returned from the
                # stored .sconsign entry to have already been converted
                # to Nodes for us.  (We used to run them through a
                # source_factory function here.)

            

Reported by Pylint.

Assigning result of a function call, where the function returns None
Error

Line: 1620 Column: 9

                      if self.always_build:
            return "rebuilding `%s' because AlwaysBuild() is specified\n" % self

        old = self.get_stored_info()
        if old is None:
            return None

        old = old.binfo
        old.prepare_dependencies()

            

Reported by Pylint.

Instance of 'Node' has no 'dir' member
Error

Line: 1647 Column: 29

                      # so we only print them after running them through this lambda
        # to turn them into the right relative Node and then return
        # its string.
        def stringify( s, E=self.dir.Entry):
            if hasattr( s, 'dir' ) :
                return str(E(s))
            return str(s)

        lines = []

            

Reported by Pylint.

Unused argument 'node'
Error

Line: 111 Column: 21

              
# A variable that can be set to an interface-specific function be called
# to annotate a Node with information about its creation.
def do_nothing_node(node): pass

Annotate = do_nothing_node

# Gets set to 'True' if we're running in interactive mode. Is
# currently used to release parts of a target's info during

            

Reported by Pylint.

Unused argument 'node'
Error

Line: 135 Column: 19

              def exists_none(node):
    raise NotImplementedError

def exists_always(node):
    return 1

def exists_base(node):
    return node.stat() is not None


            

Reported by Pylint.

Access to a protected member _func_exists of a client class
Error

Line: 146 Column: 24

                  what we should turn into first.  Assume a file if there's no
    directory."""
    node.disambiguate()
    return _exists_map[node._func_exists](node)


def exists_file(node):
    # Duplicate from source path if we are set up to do this.
    if node.duplicate and not node.is_derived() and not node.linked:

            

Reported by Pylint.

Access to a protected member _func_get_contents of a client class
Error

Line: 209 Column: 34

                      # or catch the exception.
        return ''
    else:
        return _get_contents_map[node._func_get_contents](node)

def get_contents_dir(node):
    """Return content signatures and names of all our children
    separated by new-lines. Ensure that the nodes are sorted."""
    contents = []

            

Reported by Pylint.

Unused argument 'target'
Error

Line: 280 Column: 42

                  raise NotImplementedError


def changed_since_last_build_alias(node, target, prev_ni, repo_node=None):
    cur_csig = node.get_csig()
    try:
        return cur_csig != prev_ni.csig
    except AttributeError:
        return 1

            

Reported by Pylint.

Unused argument 'repo_node'
Error

Line: 280 Column: 59

                  raise NotImplementedError


def changed_since_last_build_alias(node, target, prev_ni, repo_node=None):
    cur_csig = node.get_csig()
    try:
        return cur_csig != prev_ni.csig
    except AttributeError:
        return 1

            

Reported by Pylint.

Unused argument 'repo_node'
Error

Line: 293 Column: 67

                  return _decider_map[node.changed_since_last_build](node, target, prev_ni, repo_node)


def changed_since_last_build_state_changed(node, target, prev_ni, repo_node=None):
    return node.state != SCons.Node.up_to_date


def decide_source(node, target, prev_ni, repo_node=None):
    return target.get_build_env().decide_source(node, target, prev_ni, repo_node)

            

Reported by Pylint.

src/third_party/wiredtiger/test/3rdparty/python-subunit-0.0.16/python/subunit/test_results.py
216 issues
Unable to import 'testtools'
Error

Line: 22 Column: 1

              import csv
import datetime

import testtools
from testtools.compat import all
from testtools.content import (
    text_content,
    TracebackContent,
    )

            

Reported by Pylint.

Unable to import 'testtools.compat'
Error

Line: 23 Column: 1

              import datetime

import testtools
from testtools.compat import all
from testtools.content import (
    text_content,
    TracebackContent,
    )
from testtools import StreamResult

            

Reported by Pylint.

Unable to import 'testtools.content'
Error

Line: 24 Column: 1

              
import testtools
from testtools.compat import all
from testtools.content import (
    text_content,
    TracebackContent,
    )
from testtools import StreamResult


            

Reported by Pylint.

Unable to import 'testtools'
Error

Line: 28 Column: 1

                  text_content,
    TracebackContent,
    )
from testtools import StreamResult

from subunit import iso8601
import subunit



            

Reported by Pylint.

Instance of 'HookedTestResultDecorator' has no '_before_event' member
Error

Line: 122 Column: 9

                      self.super.__init__(decorated)

    def startTest(self, test):
        self._before_event()
        return self.super.startTest(test)

    def startTestRun(self):
        self._before_event()
        return self.super.startTestRun()

            

Reported by Pylint.

Instance of 'HookedTestResultDecorator' has no '_before_event' member
Error

Line: 126 Column: 9

                      return self.super.startTest(test)

    def startTestRun(self):
        self._before_event()
        return self.super.startTestRun()

    def stopTest(self, test):
        self._before_event()
        return self.super.stopTest(test)

            

Reported by Pylint.

Instance of 'HookedTestResultDecorator' has no '_before_event' member
Error

Line: 130 Column: 9

                      return self.super.startTestRun()

    def stopTest(self, test):
        self._before_event()
        return self.super.stopTest(test)

    def stopTestRun(self):
        self._before_event()
        return self.super.stopTestRun()

            

Reported by Pylint.

Instance of 'HookedTestResultDecorator' has no '_before_event' member
Error

Line: 134 Column: 9

                      return self.super.stopTest(test)

    def stopTestRun(self):
        self._before_event()
        return self.super.stopTestRun()

    def addError(self, test, err=None, details=None):
        self._before_event()
        return self.super.addError(test, err, details=details)

            

Reported by Pylint.

Instance of 'HookedTestResultDecorator' has no '_before_event' member
Error

Line: 138 Column: 9

                      return self.super.stopTestRun()

    def addError(self, test, err=None, details=None):
        self._before_event()
        return self.super.addError(test, err, details=details)

    def addFailure(self, test, err=None, details=None):
        self._before_event()
        return self.super.addFailure(test, err, details=details)

            

Reported by Pylint.

Instance of 'HookedTestResultDecorator' has no '_before_event' member
Error

Line: 142 Column: 9

                      return self.super.addError(test, err, details=details)

    def addFailure(self, test, err=None, details=None):
        self._before_event()
        return self.super.addFailure(test, err, details=details)

    def addSuccess(self, test, details=None):
        self._before_event()
        return self.super.addSuccess(test, details=details)

            

Reported by Pylint.