The following issues were found
Lib/queue.py
5 issues
Line: 21
Column: 9
except ImportError:
class Empty(Exception):
'Exception raised by Queue.get(block=0)/get_nowait().'
pass
class Full(Exception):
'Exception raised by Queue.put(block=0)/put_nowait().'
pass
Reported by Pylint.
Line: 25
Column: 5
class Full(Exception):
'Exception raised by Queue.put(block=0)/put_nowait().'
pass
class Queue:
'''Create a queue object with a given maximum size.
Reported by Pylint.
Line: 206
Column: 21
# These will only be called with appropriate locks held
# Initialize the queue representation
def _init(self, maxsize):
self.queue = deque()
def _qsize(self):
return len(self.queue)
Reported by Pylint.
Line: 272
Column: 37
self._queue = deque()
self._count = threading.Semaphore(0)
def put(self, item, block=True, timeout=None):
'''Put the item on the queue.
The optional 'block' and 'timeout' arguments are ignored, as this method
never blocks. They are provided for compatibility with the Queue class.
'''
Reported by Pylint.
Line: 272
Column: 25
self._queue = deque()
self._count = threading.Semaphore(0)
def put(self, item, block=True, timeout=None):
'''Put the item on the queue.
The optional 'block' and 'timeout' arguments are ignored, as this method
never blocks. They are provided for compatibility with the Queue class.
'''
Reported by Pylint.
Lib/test/test_import/data/circular_imports/subpkg2/parent/child.py
5 issues
Line: 1
Column: 1
import test.test_import.data.circular_imports.subpkg2.parent
test.test_import.data.circular_imports.subpkg2.parent
Reported by Pylint.
Line: 1
Column: 1
import test.test_import.data.circular_imports.subpkg2.parent
test.test_import.data.circular_imports.subpkg2.parent
Reported by Pylint.
Line: 3
Column: 1
import test.test_import.data.circular_imports.subpkg2.parent
test.test_import.data.circular_imports.subpkg2.parent
Reported by Pylint.
Line: 3
Column: 1
import test.test_import.data.circular_imports.subpkg2.parent
test.test_import.data.circular_imports.subpkg2.parent
Reported by Pylint.
Line: 1
Column: 1
import test.test_import.data.circular_imports.subpkg2.parent
test.test_import.data.circular_imports.subpkg2.parent
Reported by Pylint.
Lib/multiprocessing/__init__.py
5 issues
Line: 16
Column: 1
#
import sys
from . import context
#
# Copy stuff from default context
#
Reported by Pylint.
Line: 22
Column: 27
# Copy stuff from default context
#
__all__ = [x for x in dir(context._default_context) if not x.startswith('_')]
globals().update((name, getattr(context._default_context, name)) for name in __all__)
#
# XXX These should not really be documented or public.
#
Reported by Pylint.
Line: 23
Column: 33
#
__all__ = [x for x in dir(context._default_context) if not x.startswith('_')]
globals().update((name, getattr(context._default_context, name)) for name in __all__)
#
# XXX These should not really be documented or public.
#
Reported by Pylint.
Line: 26
Column: 3
globals().update((name, getattr(context._default_context, name)) for name in __all__)
#
# XXX These should not really be documented or public.
#
SUBDEBUG = 5
SUBWARNING = 25
Reported by Pylint.
Line: 1
Column: 1
#
# Package analogous to 'threading.py' but using processes
#
# multiprocessing/__init__.py
#
# This package is intended to duplicate the functionality (and much of
# the API) of threading.py but uses processes instead of threads. A
# subpackage 'multiprocessing.dummy' has the same API but is a simple
# wrapper for 'threading'.
Reported by Pylint.
Lib/lib2to3/tests/data/fixers/myfixes/fix_explicit.py
5 issues
Line: 3
Column: 1
from lib2to3.fixer_base import BaseFix
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
Reported by Pylint.
Line: 6
Column: 5
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
Reported by Pylint.
Line: 1
Column: 1
from lib2to3.fixer_base import BaseFix
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
Reported by Pylint.
Line: 3
Column: 1
from lib2to3.fixer_base import BaseFix
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
Reported by Pylint.
Line: 6
Column: 22
class FixExplicit(BaseFix):
explicit = True
def match(self): return False
Reported by Pylint.
Lib/test/test_future5.py
5 issues
Line: 1
Column: 1
# Check that multiple features can be enabled.
from __future__ import unicode_literals, print_function
import sys
import unittest
from test import support
class TestMultipleFeatures(unittest.TestCase):
Reported by Pylint.
Line: 9
Column: 1
from test import support
class TestMultipleFeatures(unittest.TestCase):
def test_unicode_literals(self):
self.assertIsInstance("", str)
def test_print_function(self):
Reported by Pylint.
Line: 11
Column: 5
class TestMultipleFeatures(unittest.TestCase):
def test_unicode_literals(self):
self.assertIsInstance("", str)
def test_print_function(self):
with support.captured_output("stderr") as s:
print("foo", file=sys.stderr)
Reported by Pylint.
Line: 14
Column: 5
def test_unicode_literals(self):
self.assertIsInstance("", str)
def test_print_function(self):
with support.captured_output("stderr") as s:
print("foo", file=sys.stderr)
self.assertEqual(s.getvalue(), "foo\n")
Reported by Pylint.
Line: 15
Column: 51
self.assertIsInstance("", str)
def test_print_function(self):
with support.captured_output("stderr") as s:
print("foo", file=sys.stderr)
self.assertEqual(s.getvalue(), "foo\n")
if __name__ == '__main__':
Reported by Pylint.
Lib/test/test_importlib/update-zips.py
5 issues
Line: 53
Column: 1
yield res, rel
__name__ == '__main__' and main()
Reported by Pylint.
Line: 1
Column: 1
"""
Generate the zip test data files.
Run to build the tests/zipdataNN/ziptestdata.zip files from
files in tests/dataNN.
Replaces the file with the working copy, but does commit anything
to the source repo.
"""
Reported by Pylint.
Line: 33
Column: 1
tuple(map(generate, suffixes))
def generate(suffix):
root = pathlib.Path(__file__).parent.relative_to(os.getcwd())
zfpath = root / f'zipdata{suffix}/ziptestdata.zip'
with zipfile.ZipFile(zfpath, 'w') as zf:
for src, rel in walk(root / f'data{suffix}'):
dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix())
Reported by Pylint.
Line: 36
Column: 42
def generate(suffix):
root = pathlib.Path(__file__).parent.relative_to(os.getcwd())
zfpath = root / f'zipdata{suffix}/ziptestdata.zip'
with zipfile.ZipFile(zfpath, 'w') as zf:
for src, rel in walk(root / f'data{suffix}'):
dst = 'ziptestdata' / pathlib.PurePosixPath(rel.as_posix())
print(src, '->', dst)
zf.write(src, dst)
Reported by Pylint.
Line: 43
Column: 1
zf.write(src, dst)
def walk(datapath):
for dirpath, dirnames, filenames in os.walk(datapath):
with contextlib.suppress(KeyError):
dirnames.remove('__pycache__')
for filename in filenames:
res = pathlib.Path(dirpath) / filename
Reported by Pylint.
Lib/test/test_nis.py
5 issues
Line: 1
Column: 1
from test import support
from test.support import import_helper
import unittest
# Skip test if nis module does not exist.
nis = import_helper.import_module('nis')
Reported by Pylint.
Line: 1
Column: 1
from test import support
from test.support import import_helper
import unittest
# Skip test if nis module does not exist.
nis = import_helper.import_module('nis')
Reported by Pylint.
Line: 10
Column: 1
nis = import_helper.import_module('nis')
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error as msg:
# NIS is probably not active, so this test isn't useful
Reported by Pylint.
Line: 11
Column: 5
class NisTests(unittest.TestCase):
def test_maps(self):
try:
maps = nis.maps()
except nis.error as msg:
# NIS is probably not active, so this test isn't useful
self.skipTest(str(msg))
Reported by Pylint.
Line: 27
Column: 20
done = 0
for nismap in maps:
mapping = nis.cat(nismap)
for k, v in mapping.items():
if not k:
continue
if nis.match(k, nismap) != v:
self.fail("NIS match failed for key `%s' in map `%s'" % (k, nismap))
else:
Reported by Pylint.
Lib/test/test_idle.py
5 issues
Line: 18
Column: 1
# Unittest.main and test.libregrtest.runtest.runtest_inner
# call load_tests, when present here, to discover tests to run.
from idlelib.idle_test import load_tests
if __name__ == '__main__':
tk.NoDefaultRoot()
unittest.main(exit=False)
tk._support_default_root = True
Reported by Pylint.
Line: 23
Column: 5
if __name__ == '__main__':
tk.NoDefaultRoot()
unittest.main(exit=False)
tk._support_default_root = True
tk._default_root = None
Reported by Pylint.
Line: 24
Column: 5
tk.NoDefaultRoot()
unittest.main(exit=False)
tk._support_default_root = True
tk._default_root = None
Reported by Pylint.
Line: 1
Column: 1
import unittest
from test.support.import_helper import import_module
# Skip test_idle if _tkinter wasn't built, if tkinter is missing,
# if tcl/tk is not the 8.5+ needed for ttk widgets,
# or if idlelib is missing (not installed).
tk = import_module('tkinter') # Also imports _tkinter.
if tk.TkVersion < 8.5:
raise unittest.SkipTest("IDLE requires tk 8.5 or later.")
Reported by Pylint.
Line: 18
Column: 1
# Unittest.main and test.libregrtest.runtest.runtest_inner
# call load_tests, when present here, to discover tests to run.
from idlelib.idle_test import load_tests
if __name__ == '__main__':
tk.NoDefaultRoot()
unittest.main(exit=False)
tk._support_default_root = True
Reported by Pylint.
Lib/test/test_lltrace.py
5 issues
Line: 1
Column: 1
import os
import textwrap
import unittest
from test.support import os_helper
from test.support.script_helper import assert_python_ok
class TestLLTrace(unittest.TestCase):
Reported by Pylint.
Line: 1
Column: 1
import os
import textwrap
import unittest
from test.support import os_helper
from test.support.script_helper import assert_python_ok
class TestLLTrace(unittest.TestCase):
Reported by Pylint.
Line: 9
Column: 1
from test.support.script_helper import assert_python_ok
class TestLLTrace(unittest.TestCase):
def test_lltrace_does_not_crash_on_subscript_operator(self):
# If this test fails, it will reproduce a crash reported as
# bpo-34113. The crash happened at the command line console of
# debug Python builds with __ltrace__ enabled (only possible in console),
Reported by Pylint.
Line: 11
Column: 5
class TestLLTrace(unittest.TestCase):
def test_lltrace_does_not_crash_on_subscript_operator(self):
# If this test fails, it will reproduce a crash reported as
# bpo-34113. The crash happened at the command line console of
# debug Python builds with __ltrace__ enabled (only possible in console),
# when the interal Python stack was negatively adjusted
with open(os_helper.TESTFN, 'w', encoding='utf-8') as fd:
Reported by Pylint.
Line: 16
Column: 63
# bpo-34113. The crash happened at the command line console of
# debug Python builds with __ltrace__ enabled (only possible in console),
# when the interal Python stack was negatively adjusted
with open(os_helper.TESTFN, 'w', encoding='utf-8') as fd:
self.addCleanup(os_helper.unlink, os_helper.TESTFN)
fd.write(textwrap.dedent("""\
import code
console = code.InteractiveConsole()
Reported by Pylint.
Lib/test/test_import/data/circular_imports/source.py
4 issues
Line: 1
Column: 1
from . import use
spam = 1
Reported by Pylint.
Line: 1
Column: 1
from . import use
spam = 1
Reported by Pylint.
Line: 1
Column: 1
from . import use
spam = 1
Reported by Pylint.
Line: 2
Column: 1
from . import use
spam = 1
Reported by Pylint.