The following issues were found

Tools/msi/generate_md5.py
7 issues
Use of insecure MD2, MD4, MD5, or SHA1 hash function.
Security blacklist

Line: 14
Suggestion: https://bandit.readthedocs.io/en/latest/blacklists/blacklist_calls.html#b303-md5

              
        with open(file, 'rb') as f:
            data = f.read()
            md5 = hashlib.md5()
            md5.update(data)
            filenames.append(os.path.split(file)[1])
            hashes.append(md5.hexdigest())
            sizes.append(str(len(data)))


            

Reported by Bandit.

Missing module docstring
Error

Line: 1 Column: 1

              import hashlib
import os
import sys

def main():
    filenames, hashes, sizes = [], [], []

    for file in sys.argv[1:]:
        if not os.path.isfile(file):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 5 Column: 1

              import os
import sys

def main():
    filenames, hashes, sizes = [], [], []

    for file in sys.argv[1:]:
        if not os.path.isfile(file):
            continue

            

Reported by Pylint.

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

Line: 12 Column: 34

                      if not os.path.isfile(file):
            continue

        with open(file, 'rb') as f:
            data = f.read()
            md5 = hashlib.md5()
            md5.update(data)
            filenames.append(os.path.split(file)[1])
            hashes.append(md5.hexdigest())

            

Reported by Pylint.

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

Line: 21 Column: 12

                          sizes.append(str(len(data)))

    print('{:40s}  {:<32s}  {:<9s}'.format('File', 'MD5', 'Size'))
    for f, h, s in zip(filenames, hashes, sizes):
        print('{:40s}  {:>32s}  {:>9s}'.format(f, h, s))



if __name__ == "__main__":

            

Reported by Pylint.

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

Line: 21 Column: 15

                          sizes.append(str(len(data)))

    print('{:40s}  {:<32s}  {:<9s}'.format('File', 'MD5', 'Size'))
    for f, h, s in zip(filenames, hashes, sizes):
        print('{:40s}  {:>32s}  {:>9s}'.format(f, h, s))



if __name__ == "__main__":

            

Reported by Pylint.

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

Line: 21 Column: 9

                          sizes.append(str(len(data)))

    print('{:40s}  {:<32s}  {:<9s}'.format('File', 'MD5', 'Size'))
    for f, h, s in zip(filenames, hashes, sizes):
        print('{:40s}  {:>32s}  {:>9s}'.format(f, h, s))



if __name__ == "__main__":

            

Reported by Pylint.

Modules/_blake2/impl/blake2s.c
7 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 159 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2s_param_set_salt( blake2s_param *P, const uint8_t salt[BLAKE2S_SALTBYTES] )
{
  memcpy( P->salt, salt, BLAKE2S_SALTBYTES );
  return 0;
}

static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 165 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] )
{
  memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES );
  return 0;
}

static inline int blake2s_init0( blake2s_state *S )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 258 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                {
    uint8_t block[BLAKE2S_BLOCKBYTES];
    memset( block, 0, BLAKE2S_BLOCKBYTES );
    memcpy( block, key, keylen );
    blake2s_update( S, block, BLAKE2S_BLOCKBYTES );
    secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */
  }
  return 0;
}

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 333 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
    if( inlen > fill )
    {
      memcpy( S->buf + left, in, fill ); // Fill buffer
      S->buflen += fill;
      blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
      blake2s_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2S_BLOCKBYTES;

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 337 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    S->buflen += fill;
      blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
      blake2s_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2S_BLOCKBYTES;
      in += fill;
      inlen -= fill;
    }
    else /* inlen <= fill */

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 344 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }
    else /* inlen <= fill */
    {
      memcpy( S->buf + left, in, inlen );
      S->buflen += inlen; // Be lazy, do not compress
      in += inlen;
      inlen -= inlen;
    }
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 377 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                for( int i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
    store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );

  memcpy( out, buffer, outlen );
  return 0;
}

int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{

            

Reported by FlawFinder.

Modules/_blake2/impl/blake2s-ref.c
7 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 122 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2s_param_set_salt( blake2s_param *P, const uint8_t salt[BLAKE2S_SALTBYTES] )
{
  memcpy( P->salt, salt, BLAKE2S_SALTBYTES );
  return 0;
}

static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 128 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2s_param_set_personal( blake2s_param *P, const uint8_t personal[BLAKE2S_PERSONALBYTES] )
{
  memcpy( P->personal, personal, BLAKE2S_PERSONALBYTES );
  return 0;
}

static inline int blake2s_init0( blake2s_state *S )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 216 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                {
    uint8_t block[BLAKE2S_BLOCKBYTES];
    memset( block, 0, BLAKE2S_BLOCKBYTES );
    memcpy( block, key, keylen );
    blake2s_update( S, block, BLAKE2S_BLOCKBYTES );
    secure_zero_memory( block, BLAKE2S_BLOCKBYTES ); /* Burn the key from stack */
  }
  return 0;
}

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 293 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
    if( inlen > fill )
    {
      memcpy( S->buf + left, in, fill ); // Fill buffer
      S->buflen += fill;
      blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
      blake2s_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2S_BLOCKBYTES;

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 297 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    S->buflen += fill;
      blake2s_increment_counter( S, BLAKE2S_BLOCKBYTES );
      blake2s_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2S_BLOCKBYTES, BLAKE2S_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2S_BLOCKBYTES;
      in += fill;
      inlen -= fill;
    }
    else // inlen <= fill

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 304 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }
    else // inlen <= fill
    {
      memcpy( S->buf + left, in, inlen );
      S->buflen += ( uint32_t ) inlen; // Be lazy, do not compress
      in += inlen;
      inlen -= inlen;
    }
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 337 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
    store32( buffer + sizeof( S->h[i] ) * i, S->h[i] );

  memcpy( out, buffer, outlen );
  return 0;
}

int blake2s( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{

            

Reported by FlawFinder.

Modules/_blake2/impl/blake2b.c
7 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 171 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] )
{
  memcpy( P->salt, salt, BLAKE2B_SALTBYTES );
  return 0;
}

static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 177 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
{
  memcpy( P->personal, personal, BLAKE2B_PERSONALBYTES );
  return 0;
}

static inline int blake2b_init0( blake2b_state *S )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 273 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                {
    uint8_t block[BLAKE2B_BLOCKBYTES];
    memset( block, 0, BLAKE2B_BLOCKBYTES );
    memcpy( block, key, keylen );
    blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
    secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */
  }
  return 0;
}

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 360 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
    if( inlen > fill )
    {
      memcpy( S->buf + left, in, fill ); // Fill buffer
      S->buflen += fill;
      blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
      blake2b_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2B_BLOCKBYTES;

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 364 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    S->buflen += fill;
      blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
      blake2b_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2B_BLOCKBYTES;
      in += fill;
      inlen -= fill;
    }
    else // inlen <= fill

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 371 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }
    else // inlen <= fill
    {
      memcpy( S->buf + left, in, inlen );
      S->buflen += ( uint32_t ) inlen; // Be lazy, do not compress
      in += inlen;
      inlen -= inlen;
    }
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 398 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                blake2b_set_lastblock( S );
  memset( S->buf + S->buflen, 0, 2 * BLAKE2B_BLOCKBYTES - S->buflen ); /* Padding */
  blake2b_compress( S, S->buf );
  memcpy( out, &S->h[0], outlen );
  return 0;
}


int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )

            

Reported by FlawFinder.

Modules/_blake2/impl/blake2b-ref.c
7 issues
memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 129 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2b_param_set_salt( blake2b_param *P, const uint8_t salt[BLAKE2B_SALTBYTES] )
{
  memcpy( P->salt, salt, BLAKE2B_SALTBYTES );
  return 0;
}

static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 135 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
static inline int blake2b_param_set_personal( blake2b_param *P, const uint8_t personal[BLAKE2B_PERSONALBYTES] )
{
  memcpy( P->personal, personal, BLAKE2B_PERSONALBYTES );
  return 0;
}

static inline int blake2b_init0( blake2b_state *S )
{

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 223 Column: 5 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                {
    uint8_t block[BLAKE2B_BLOCKBYTES];
    memset( block, 0, BLAKE2B_BLOCKBYTES );
    memcpy( block, key, keylen );
    blake2b_update( S, block, BLAKE2B_BLOCKBYTES );
    secure_zero_memory( block, BLAKE2B_BLOCKBYTES ); /* Burn the key from stack */
  }
  return 0;
}

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 303 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

              
    if( inlen > fill )
    {
      memcpy( S->buf + left, in, fill ); // Fill buffer
      S->buflen += fill;
      blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
      blake2b_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2B_BLOCKBYTES;

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 307 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                    S->buflen += fill;
      blake2b_increment_counter( S, BLAKE2B_BLOCKBYTES );
      blake2b_compress( S, S->buf ); // Compress
      memcpy( S->buf, S->buf + BLAKE2B_BLOCKBYTES, BLAKE2B_BLOCKBYTES ); // Shift buffer left
      S->buflen -= BLAKE2B_BLOCKBYTES;
      in += fill;
      inlen -= fill;
    }
    else // inlen <= fill

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 314 Column: 7 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                  }
    else // inlen <= fill
    {
      memcpy( S->buf + left, in, inlen );
      S->buflen += ( uint32_t ) inlen; // Be lazy, do not compress
      in += inlen;
      inlen -= inlen;
    }
  }

            

Reported by FlawFinder.

memcpy - Does not check for buffer overflows when copying to destination
Security

Line: 347 Column: 3 CWE codes: 120
Suggestion: Make sure destination can always hold the source data

                for( i = 0; i < 8; ++i ) /* Output full hash to temp buffer */
    store64( buffer + sizeof( S->h[i] ) * i, S->h[i] );

  memcpy( out, buffer, outlen );
  return 0;
}

int blake2b( uint8_t *out, const void *in, const void *key, size_t outlen, size_t inlen, size_t keylen )
{

            

Reported by FlawFinder.

Tools/c-analyzer/c_parser/preprocessor/pure.py
7 issues
Attempted relative import beyond top-level package
Error

Line: 1 Column: 1

              from ..source import (
    opened as _open_source,
)
from . import common as _common


def preprocess(lines, filename=None):
    if isinstance(lines, str):
        with _open_source(lines, filename) as (lines, filename):

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              from ..source import (
    opened as _open_source,
)
from . import common as _common


def preprocess(lines, filename=None):
    if isinstance(lines, str):
        with _open_source(lines, filename) as (lines, filename):

            

Reported by Pylint.

XXX actually preprocess...
Error

Line: 13 Column: 3

                          yield from preprocess(lines, filename)
        return

    # XXX actually preprocess...
    for lno, line in enumerate(lines, 1):
        kind = 'source'
        data = line
        conditions = None
        yield _common.SourceLine(

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              from ..source import (
    opened as _open_source,
)
from . import common as _common


def preprocess(lines, filename=None):
    if isinstance(lines, str):
        with _open_source(lines, filename) as (lines, filename):

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 7 Column: 1

              from . import common as _common


def preprocess(lines, filename=None):
    if isinstance(lines, str):
        with _open_source(lines, filename) as (lines, filename):
            yield from preprocess(lines, filename)
        return


            

Reported by Pylint.

Redefining argument with the local name 'filename'
Error

Line: 9 Column: 55

              
def preprocess(lines, filename=None):
    if isinstance(lines, str):
        with _open_source(lines, filename) as (lines, filename):
            yield from preprocess(lines, filename)
        return

    # XXX actually preprocess...
    for lno, line in enumerate(lines, 1):

            

Reported by Pylint.

Redefining argument with the local name 'lines'
Error

Line: 9 Column: 48

              
def preprocess(lines, filename=None):
    if isinstance(lines, str):
        with _open_source(lines, filename) as (lines, filename):
            yield from preprocess(lines, filename)
        return

    # XXX actually preprocess...
    for lno, line in enumerate(lines, 1):

            

Reported by Pylint.

Tools/c-analyzer/cpython/_files.py
7 issues
Attempted relative import beyond top-level package
Error

Line: 4 Column: 1

              import os.path

from c_common.fsutil import expand_filenames, iter_files_by_suffix
from . import REPO_ROOT, INCLUDE_DIRS, SOURCE_DIRS


GLOBS = [
    'Include/*.h',
    'Include/internal/*.h',

            

Reported by Pylint.

XXX Log it and continue instead?
Error

Line: 68 Column: 3

                      elif filename.endswith('.h'):
            yield filename
        else:
            # XXX Log it and continue instead?
            raise ValueError(f'expected .h file, got {orig!r}')

            

Reported by Pylint.

Missing module docstring
Error

Line: 1 Column: 1

              import os.path

from c_common.fsutil import expand_filenames, iter_files_by_suffix
from . import REPO_ROOT, INCLUDE_DIRS, SOURCE_DIRS


GLOBS = [
    'Include/*.h',
    'Include/internal/*.h',

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 26 Column: 1

              }


def resolve_filename(filename):
    orig = filename
    filename = os.path.normcase(os.path.normpath(filename))
    if os.path.isabs(filename):
        if os.path.relpath(filename, REPO_ROOT).startswith('.'):
            raise Exception(f'{orig!r} is outside the repo ({REPO_ROOT})')

            

Reported by Pylint.

Unnecessary "else" after "return"
Error

Line: 29 Column: 5

              def resolve_filename(filename):
    orig = filename
    filename = os.path.normcase(os.path.normpath(filename))
    if os.path.isabs(filename):
        if os.path.relpath(filename, REPO_ROOT).startswith('.'):
            raise Exception(f'{orig!r} is outside the repo ({REPO_ROOT})')
        return filename
    else:
        return os.path.join(REPO_ROOT, filename)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 37 Column: 1

                      return os.path.join(REPO_ROOT, filename)


def iter_filenames(*, search=False):
    if search:
        yield from iter_files_by_suffix(INCLUDE_DIRS, ('.h',))
        yield from iter_files_by_suffix(SOURCE_DIRS, ('.c',))
    else:
        globs = (os.path.join(REPO_ROOT, file) for file in GLOBS)

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 46 Column: 1

                      yield from expand_filenames(globs)


def iter_header_files(filenames=None, *, levels=None):
    if not filenames:
        if levels:
            levels = set(levels)
            if 'private' in levels:
                levels.add('stable')

            

Reported by Pylint.

Lib/lib2to3/fixes/fix_raw_input.py
7 issues
Attempted relative import beyond top-level package
Error

Line: 5 Column: 1

              # Author: Andre Roberge

# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixRawInput(fixer_base.BaseFix):

    BM_compatible = True

            

Reported by Pylint.

Attempted relative import beyond top-level package
Error

Line: 6 Column: 1

              
# Local imports
from .. import fixer_base
from ..fixer_util import Name

class FixRawInput(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """

            

Reported by Pylint.

Unused argument 'node'
Error

Line: 15 Column: 25

                            power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("input", prefix=name.prefix))

            

Reported by Pylint.

Too few public methods (1/2)
Error

Line: 8 Column: 1

              from .. import fixer_base
from ..fixer_util import Name

class FixRawInput(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

            

Reported by Pylint.

Missing class docstring
Error

Line: 8 Column: 1

              from .. import fixer_base
from ..fixer_util import Name

class FixRawInput(fixer_base.BaseFix):

    BM_compatible = True
    PATTERN = """
              power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

            

Reported by Pylint.

Method could be a function
Error

Line: 15 Column: 5

                            power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("input", prefix=name.prefix))

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 15 Column: 5

                            power< name='raw_input' trailer< '(' [any] ')' > any* >
              """

    def transform(self, node, results):
        name = results["name"]
        name.replace(Name("input", prefix=name.prefix))

            

Reported by Pylint.

Lib/email/parser.py
7 issues
Access to a protected member _set_headersonly of a client class
Error

Line: 51 Column: 13

                      """
        feedparser = FeedParser(self._class, policy=self.policy)
        if headersonly:
            feedparser._set_headersonly()
        while True:
            data = fp.read(8192)
            if not data:
                break
            feedparser.feed(data)

            

Reported by Pylint.

Missing class docstring
Error

Line: 16 Column: 1

              from email._policybase import compat32


class Parser:
    def __init__(self, _class=None, *, policy=compat32):
        """Parser of RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which
        can then be manipulated and turned over to a Generator to return the

            

Reported by Pylint.

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

Line: 41 Column: 5

                      self._class = _class
        self.policy = policy

    def parse(self, fp, headersonly=False):
        """Create a message structure from the data in a file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,

            

Reported by Pylint.

Missing class docstring
Error

Line: 71 Column: 1

              


class HeaderParser(Parser):
    def parse(self, fp, headersonly=True):
        return Parser.parse(self, fp, True)

    def parsestr(self, text, headersonly=True):
        return Parser.parsestr(self, text, True)

            

Reported by Pylint.

Missing class docstring
Error

Line: 79 Column: 1

                      return Parser.parsestr(self, text, True)


class BytesParser:

    def __init__(self, *args, **kw):
        """Parser of binary RFC 2822 and MIME email messages.

        Creates an in-memory object tree representing the email message, which

            

Reported by Pylint.

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

Line: 99 Column: 5

                      """
        self.parser = Parser(*args, **kw)

    def parse(self, fp, headersonly=False):
        """Create a message structure from the data in a binary file.

        Reads all the data from the file and returns the root of the message
        structure.  Optional headersonly is a flag specifying whether to stop
        parsing after reading the headers or not.  The default is False,

            

Reported by Pylint.

Missing class docstring
Error

Line: 126 Column: 1

                      return self.parser.parsestr(text, headersonly)


class BytesHeaderParser(BytesParser):
    def parse(self, fp, headersonly=True):
        return BytesParser.parse(self, fp, headersonly=True)

    def parsebytes(self, text, headersonly=True):
        return BytesParser.parsebytes(self, text, headersonly=True)

            

Reported by Pylint.

Lib/idlelib/idle_test/template.py
7 issues
Unused zzdummy imported from idlelib
Error

Line: 3 Column: 1

              "Test , coverage %."

from idlelib import zzdummy
import unittest
from test.support import requires
from tkinter import Tk


class Test(unittest.TestCase):

            

Reported by Pylint.

Redundant use of assertTrue with constant value True
Error

Line: 26 Column: 9

                      del cls.root

    def test_init(self):
        self.assertTrue(True)


if __name__ == '__main__':
    unittest.main(verbosity=2)

            

Reported by Pylint.

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

Line: 4 Column: 1

              "Test , coverage %."

from idlelib import zzdummy
import unittest
from test.support import requires
from tkinter import Tk


class Test(unittest.TestCase):

            

Reported by Pylint.

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

Line: 5 Column: 1

              
from idlelib import zzdummy
import unittest
from test.support import requires
from tkinter import Tk


class Test(unittest.TestCase):


            

Reported by Pylint.

standard import "from tkinter import Tk" should be placed before "from idlelib import zzdummy"
Error

Line: 6 Column: 1

              from idlelib import zzdummy
import unittest
from test.support import requires
from tkinter import Tk


class Test(unittest.TestCase):

    @classmethod

            

Reported by Pylint.

Missing class docstring
Error

Line: 9 Column: 1

              from tkinter import Tk


class Test(unittest.TestCase):

    @classmethod
    def setUpClass(cls):
        requires('gui')
        cls.root = Tk()

            

Reported by Pylint.

Missing function or method docstring
Error

Line: 25 Column: 5

                      cls.root.destroy()
        del cls.root

    def test_init(self):
        self.assertTrue(True)


if __name__ == '__main__':
    unittest.main(verbosity=2)

            

Reported by Pylint.