The following issues were found
Lib/test/test_codecmaps_tw.py
3 issues
Line: 1
Column: 1
#
# test_codecmaps_tw.py
# Codec mapping tests for ROC encodings
#
from test import multibytecodec_support
import unittest
class TestBIG5Map(multibytecodec_support.TestBase_Mapping,
Reported by Pylint.
Line: 9
Column: 1
from test import multibytecodec_support
import unittest
class TestBIG5Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'big5'
mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT'
class TestCP950Map(multibytecodec_support.TestBase_Mapping,
Reported by Pylint.
Line: 14
Column: 1
encoding = 'big5'
mapfileurl = 'http://www.pythontest.net/unicode/BIG5.TXT'
class TestCP950Map(multibytecodec_support.TestBase_Mapping,
unittest.TestCase):
encoding = 'cp950'
mapfileurl = 'http://www.pythontest.net/unicode/CP950.TXT'
pass_enctest = [
(b'\xa2\xcc', '\u5341'),
Reported by Pylint.
Lib/sqlite3/__init__.py
3 issues
Line: 23
Column: 1
# misrepresented as being the original software.
# 3. This notice may not be removed or altered from any source distribution.
from sqlite3.dbapi2 import *
# bpo-42264: OptimizedUnicode was deprecated in Python 3.10. It's scheduled
# for removal in Python 3.12.
def __getattr__(name):
Reported by Pylint.
Line: 1
Column: 1
# pysqlite2/__init__.py: the pysqlite2 package.
#
# Copyright (C) 2005 Gerhard Häring <gh@ghaering.de>
#
# This file is part of pysqlite.
#
# This software is provided 'as-is', without any express or implied
# warranty. In no event will the authors be held liable for any damages
# arising from the use of this software.
Reported by Pylint.
Line: 30
Column: 9
# for removal in Python 3.12.
def __getattr__(name):
if name == "OptimizedUnicode":
import warnings
msg = ("""
OptimizedUnicode is deprecated and will be removed in Python 3.12.
Since Python 3.3 it has simply been an alias for 'str'.
""")
warnings.warn(msg, DeprecationWarning, stacklevel=2)
Reported by Pylint.
Lib/test/test_codecencodings_tw.py
3 issues
Line: 1
Column: 1
#
# test_codecencodings_tw.py
# Codec encoding tests for ROC encodings.
#
from test import multibytecodec_support
import unittest
class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
Reported by Pylint.
Line: 9
Column: 1
from test import multibytecodec_support
import unittest
class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5'
tstring = multibytecodec_support.load_teststring('big5')
codectests = (
# invalid bytes
(b"abc\x80\x80\xc1\xc4", "strict", None),
Reported by Pylint.
Line: 9
Column: 1
from test import multibytecodec_support
import unittest
class Test_Big5(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5'
tstring = multibytecodec_support.load_teststring('big5')
codectests = (
# invalid bytes
(b"abc\x80\x80\xc1\xc4", "strict", None),
Reported by Pylint.
Lib/test/relimport.py
3 issues
Line: 1
Column: 1
from .test_import import *
Reported by Pylint.
Line: 1
Column: 1
from .test_import import *
Reported by Pylint.
Line: 1
Column: 1
from .test_import import *
Reported by Pylint.
Lib/test/good_getattr.py
3 issues
Line: 1
Column: 1
x = 1
def __dir__():
return ['a', 'b', 'c']
def __getattr__(name):
if name == "yolo":
raise AttributeError("Deprecated, use whatever instead")
return f"There is {name}"
Reported by Pylint.
Line: 1
Column: 1
x = 1
def __dir__():
return ['a', 'b', 'c']
def __getattr__(name):
if name == "yolo":
raise AttributeError("Deprecated, use whatever instead")
return f"There is {name}"
Reported by Pylint.
Line: 11
Column: 1
raise AttributeError("Deprecated, use whatever instead")
return f"There is {name}"
y = 2
Reported by Pylint.
Lib/lib2to3/tests/data/fixers/bad_order.py
3 issues
Line: 3
Column: 1
from lib2to3.fixer_base import BaseFix
class FixBadOrder(BaseFix):
order = "crazy"
Reported by Pylint.
Line: 1
Column: 1
from lib2to3.fixer_base import BaseFix
class FixBadOrder(BaseFix):
order = "crazy"
Reported by Pylint.
Line: 3
Column: 1
from lib2to3.fixer_base import BaseFix
class FixBadOrder(BaseFix):
order = "crazy"
Reported by Pylint.
Lib/test/test_future4.py
3 issues
Line: 1
Column: 1
from __future__ import unicode_literals
import unittest
class Tests(unittest.TestCase):
def test_unicode_literals(self):
self.assertIsInstance("literal", str)
Reported by Pylint.
Line: 5
Column: 1
import unittest
class Tests(unittest.TestCase):
def test_unicode_literals(self):
self.assertIsInstance("literal", str)
if __name__ == "__main__":
Reported by Pylint.
Line: 6
Column: 5
class Tests(unittest.TestCase):
def test_unicode_literals(self):
self.assertIsInstance("literal", str)
if __name__ == "__main__":
unittest.main()
Reported by Pylint.
Lib/test/curses_tests.py
3 issues
Line: 1
Column: 1
#!/usr/bin/env python3
#
# $Id: ncurses.py 36559 2004-07-18 05:56:09Z tim_one $
#
# Interactive test suite for the curses module.
# This script displays various things and the user should verify whether
# they display correctly.
#
Reported by Pylint.
Line: 13
Column: 1
import curses
from curses import textpad
def test_textpad(stdscr, insert_mode=False):
ncols, nlines = 8, 3
uly, ulx = 3, 2
if insert_mode:
mode = 'insert mode'
else:
Reported by Pylint.
Line: 39
Column: 1
stdscr.move(uly+ncols+2 + i, 0)
stdscr.clrtoeol()
def main(stdscr):
stdscr.clear()
test_textpad(stdscr, False)
test_textpad(stdscr, True)
Reported by Pylint.
Lib/numbers.py
3 issues
Line: 12
Column: 1
__all__ = ["Number", "Complex", "Real", "Rational", "Integral"]
class Number(metaclass=ABCMeta):
"""All numbers inherit from this class.
If you just want to check if an argument x is a number, without
caring what kind, use isinstance(x, Number).
"""
Reported by Pylint.
Line: 274
Column: 5
@property
@abstractmethod
def numerator(self):
raise NotImplementedError
@property
@abstractmethod
def denominator(self):
Reported by Pylint.
Line: 279
Column: 5
@property
@abstractmethod
def denominator(self):
raise NotImplementedError
# Concrete implementation of Real's conversion to float.
def __float__(self):
"""float(self) = self.numerator / self.denominator
Reported by Pylint.
Lib/test/test_codecencodings_hk.py
3 issues
Line: 1
Column: 1
#
# test_codecencodings_hk.py
# Codec encoding tests for HongKong encodings.
#
from test import multibytecodec_support
import unittest
class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase):
Reported by Pylint.
Line: 9
Column: 1
from test import multibytecodec_support
import unittest
class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5hkscs'
tstring = multibytecodec_support.load_teststring('big5hkscs')
codectests = (
# invalid bytes
(b"abc\x80\x80\xc1\xc4", "strict", None),
Reported by Pylint.
Line: 9
Column: 1
from test import multibytecodec_support
import unittest
class Test_Big5HKSCS(multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'big5hkscs'
tstring = multibytecodec_support.load_teststring('big5hkscs')
codectests = (
# invalid bytes
(b"abc\x80\x80\xc1\xc4", "strict", None),
Reported by Pylint.