The following issues were found
Doc/includes/sqlite3/executemany_1.py
2 issues
Line: 1
Column: 1
import sqlite3
class IterChars:
def __init__(self):
self.count = ord('a')
def __iter__(self):
return self
Reported by Pylint.
Line: 3
Column: 1
import sqlite3
class IterChars:
def __init__(self):
self.count = ord('a')
def __iter__(self):
return self
Reported by Pylint.
Lib/distutils/command/clean.py
2 issues
Line: 12
Column: 1
from distutils.dir_util import remove_tree
from distutils import log
class clean(Command):
description = "clean up temporary files from 'build' command"
user_options = [
('build-base=', 'b',
"base build directory (default: 'build.build-base')"),
Reported by Pylint.
Line: 12
Column: 1
from distutils.dir_util import remove_tree
from distutils import log
class clean(Command):
description = "clean up temporary files from 'build' command"
user_options = [
('build-base=', 'b',
"base build directory (default: 'build.build-base')"),
Reported by Pylint.
Lib/distutils/tests/__init__.py
2 issues
Line: 25
Column: 1
here = os.path.dirname(__file__) or os.curdir
def test_suite():
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "distutils.tests." + fn[:-3]
# bpo-40055: Save/restore warnings filters to leave them unchanged.
Reported by Pylint.
Line: 27
Column: 9
def test_suite():
suite = unittest.TestSuite()
for fn in os.listdir(here):
if fn.startswith("test") and fn.endswith(".py"):
modname = "distutils.tests." + fn[:-3]
# bpo-40055: Save/restore warnings filters to leave them unchanged.
# Importing tests imports docutils which imports pkg_resources
# which adds a warnings filter.
Reported by Pylint.
Lib/idlelib/idle_test/test_autocomplete_w.py
2 issues
Line: 10
Column: 1
import idlelib.autocomplete_w as acw
class AutoCompleteWindowTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
requires('gui')
cls.root = Tk()
Reported by Pylint.
Line: 27
Column: 5
cls.root.destroy()
del cls.root
def test_init(self):
self.assertEqual(self.acw.widget, self.text)
if __name__ == '__main__':
unittest.main(verbosity=2)
Reported by Pylint.
Doc/includes/email-alternative.py
2 issues
Line: 1
Column: 1
#!/usr/bin/env python3
import smtplib
from email.message import EmailMessage
from email.headerregistry import Address
from email.utils import make_msgid
# Create the base text message.
Reported by Pylint.
Line: 1
Column: 1
#!/usr/bin/env python3
import smtplib
from email.message import EmailMessage
from email.headerregistry import Address
from email.utils import make_msgid
# Create the base text message.
Reported by Pylint.
Lib/idlelib/idle_test/__init__.py
2 issues
Line: 11
Column: 40
'''
from os.path import dirname
def load_tests(loader, standard_tests, pattern):
this_dir = dirname(__file__)
top_dir = dirname(dirname(this_dir))
package_tests = loader.discover(start_dir=this_dir, pattern='test*.py',
top_level_dir=top_dir)
standard_tests.addTests(package_tests)
Reported by Pylint.
Line: 11
Column: 1
'''
from os.path import dirname
def load_tests(loader, standard_tests, pattern):
this_dir = dirname(__file__)
top_dir = dirname(dirname(this_dir))
package_tests = loader.discover(start_dir=this_dir, pattern='test*.py',
top_level_dir=top_dir)
standard_tests.addTests(package_tests)
Reported by Pylint.
Lib/idlelib/idle.py
2 issues
Line: 1
Column: 1
import os.path
import sys
# Enable running IDLE with idlelib in a non-standard location.
# This was once used to run development versions of IDLE.
# Because PEP 434 declared idle.py a public interface,
# removal should require deprecation.
idlelib_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
Reported by Pylint.
Line: 13
Column: 1
if idlelib_dir not in sys.path:
sys.path.insert(0, idlelib_dir)
from idlelib.pyshell import main # This is subject to change
main()
Reported by Pylint.
Lib/idlelib/delegator.py
2 issues
Line: 1
Column: 1
class Delegator:
def __init__(self, delegate=None):
self.delegate = delegate
self.__cache = set()
# Cache is used to only remove added attributes
# when changing the delegate.
def __getattr__(self, name):
Reported by Pylint.
Line: 1
Column: 1
class Delegator:
def __init__(self, delegate=None):
self.delegate = delegate
self.__cache = set()
# Cache is used to only remove added attributes
# when changing the delegate.
def __getattr__(self, name):
Reported by Pylint.
Lib/email/policy.py
2 issues
Line: 144
Column: 3
if hasattr(value, 'name') and value.name.lower() == name.lower():
return (name, value)
if isinstance(value, str) and len(value.splitlines())>1:
# XXX this error message isn't quite right when we use splitlines
# (see issue 22233), but I'm not sure what should happen here.
raise ValueError("Header values may not contain linefeed "
"or carriage return characters")
return (name, self.header_factory(name, value))
Reported by Pylint.
Line: 9
Column: 1
import sys
from email._policybase import Policy, Compat32, compat32, _extend_docstrings
from email.utils import _has_surrogates
from email.headerregistry import HeaderRegistry as HeaderRegistry
from email.contentmanager import raw_data_manager
from email.message import EmailMessage
__all__ = [
'Compat32',
Reported by Pylint.
Lib/email/encoders.py
2 issues
Line: 68
Column: 17
def encode_noop(msg):
"""Do nothing."""
Reported by Pylint.
Line: 20
Column: 1
def _qencode(s):
enc = _encodestring(s, quotetabs=True)
# Must encode spaces, which quopri.encodestring() doesn't do
return enc.replace(b' ', b'=20')
Reported by Pylint.