The following issues were found
tests/cpydiff/types_exception_attrs.py
4 issues
Line: 8
Column: 7
workaround: Only use ``value`` on ``StopIteration`` exceptions, and ``errno`` on ``OSError`` exceptions. Do not use or rely on these attributes on other exceptions.
"""
e = Exception(1)
print(e.value)
print(e.errno)
Reported by Pylint.
Line: 9
Column: 7
"""
e = Exception(1)
print(e.value)
print(e.errno)
Reported by Pylint.
Line: 3
Column: 1
"""
categories: Types,Exception
description: All exceptions have readable ``value`` and ``errno`` attributes, not just ``StopIteration`` and ``OSError``.
cause: MicroPython is optimised to reduce code size.
workaround: Only use ``value`` on ``StopIteration`` exceptions, and ``errno`` on ``OSError`` exceptions. Do not use or rely on these attributes on other exceptions.
"""
e = Exception(1)
print(e.value)
print(e.errno)
Reported by Pylint.
Line: 5
Column: 1
categories: Types,Exception
description: All exceptions have readable ``value`` and ``errno`` attributes, not just ``StopIteration`` and ``OSError``.
cause: MicroPython is optimised to reduce code size.
workaround: Only use ``value`` on ``StopIteration`` exceptions, and ``errno`` on ``OSError`` exceptions. Do not use or rely on these attributes on other exceptions.
"""
e = Exception(1)
print(e.value)
print(e.errno)
Reported by Pylint.
tests/extmod/btree1.py
4 issues
Line: 7
Column: 5
import uerrno
except ImportError:
print("SKIP")
raise SystemExit
# f = open("_test.db", "w+b")
f = uio.BytesIO()
db = btree.open(f, pagesize=512)
Reported by Pylint.
Line: 1
Column: 1
try:
import btree
import uio
import uerrno
except ImportError:
print("SKIP")
raise SystemExit
# f = open("_test.db", "w+b")
Reported by Pylint.
Line: 18
Column: 1
db[b"foo2"] = b"bar2"
db[b"bar1"] = b"foo1"
dbstr = str(db)
print(dbstr[:7], dbstr[-1:])
print(db[b"foo2"])
try:
print(db[b"foo"])
Reported by Pylint.
Line: 67
Column: 1
try:
db.seq(b"foo1")
except OSError as e:
print(e.errno == uerrno.EINVAL)
print(list(db.keys()))
print(list(db.values()))
Reported by Pylint.
tests/extmod/time_ms_us.py
4 issues
Line: 4
Column: 5
try:
import utime
utime.sleep_ms, utime.sleep_us, utime.ticks_diff, utime.ticks_ms, utime.ticks_us, utime.ticks_cpu
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
utime.sleep_ms(1)
Reported by Pylint.
Line: 7
Column: 5
utime.sleep_ms, utime.sleep_us, utime.ticks_diff, utime.ticks_ms, utime.ticks_us, utime.ticks_cpu
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
utime.sleep_ms(1)
utime.sleep_us(1)
t0 = utime.ticks_ms()
Reported by Pylint.
Line: 1
Column: 1
try:
import utime
utime.sleep_ms, utime.sleep_us, utime.ticks_diff, utime.ticks_ms, utime.ticks_us, utime.ticks_cpu
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
utime.sleep_ms(1)
Reported by Pylint.
Line: 4
Column: 1
try:
import utime
utime.sleep_ms, utime.sleep_us, utime.ticks_diff, utime.ticks_ms, utime.ticks_us, utime.ticks_cpu
except (ImportError, AttributeError):
print("SKIP")
raise SystemExit
utime.sleep_ms(1)
Reported by Pylint.
tests/extmod/uasyncio_basic2.py
4 issues
Line: 8
Column: 9
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def forever():
print("forever start")
await asyncio.sleep(10)
Reported by Pylint.
Line: 1
Column: 1
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 11
Column: 1
raise SystemExit
async def forever():
print("forever start")
await asyncio.sleep(10)
async def main():
Reported by Pylint.
Line: 16
Column: 1
await asyncio.sleep(10)
async def main():
print("main start")
asyncio.create_task(forever())
await asyncio.sleep(0.001)
print("main done")
return 42
Reported by Pylint.
tests/extmod/uasyncio_loop_stop.py
4 issues
Line: 10
Column: 9
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task():
print("task")
Reported by Pylint.
Line: 1
Column: 1
# Test Loop.stop() to stop the event loop
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
Reported by Pylint.
Line: 13
Column: 1
raise SystemExit
async def task():
print("task")
async def main():
print("start")
Reported by Pylint.
Line: 17
Column: 1
print("task")
async def main():
print("start")
# Stop the loop after next yield
loop.stop()
Reported by Pylint.
tests/extmod/uasyncio_new_event_loop.py
4 issues
Line: 10
Column: 9
import asyncio
except ImportError:
print("SKIP")
raise SystemExit
async def task():
for i in range(4):
print("task", i)
Reported by Pylint.
Line: 1
Column: 1
# Test Loop.new_event_loop()
try:
import uasyncio as asyncio
except ImportError:
try:
import asyncio
except ImportError:
print("SKIP")
Reported by Pylint.
Line: 13
Column: 1
raise SystemExit
async def task():
for i in range(4):
print("task", i)
await asyncio.sleep(0)
await asyncio.sleep(0)
Reported by Pylint.
Line: 20
Column: 1
await asyncio.sleep(0)
async def main():
print("start")
loop.create_task(task())
await asyncio.sleep(0)
print("stop")
loop.stop()
Reported by Pylint.
tests/extmod/ucryptolib_aes128_ctr.py
4 issues
Line: 5
Column: 5
from ucryptolib import aes
except ImportError:
print("SKIP")
raise SystemExit
def _new(k, ctr_initial):
return aes(k, 6, ctr_initial)
Reported by Pylint.
Line: 18
Column: 9
# is CTR support disabled?
if e.args[0] == "mode":
print("SKIP")
raise SystemExit
raise e
crypto = _new(b"1234" * 4, b"5678" * 4)
enc = crypto.encrypt(b"a")
print(enc)
Reported by Pylint.
Line: 1
Column: 1
try:
from ucryptolib import aes
except ImportError:
print("SKIP")
raise SystemExit
def _new(k, ctr_initial):
return aes(k, 6, ctr_initial)
Reported by Pylint.
Line: 14
Column: 1
try:
_new(b"x" * 16, b"x" * 16)
except ValueError as e:
# is CTR support disabled?
if e.args[0] == "mode":
print("SKIP")
raise SystemExit
raise e
Reported by Pylint.
tests/extmod/uctypes_32bit_intbig.py
4 issues
Line: 7
Column: 5
import uctypes
except ImportError:
print("SKIP")
raise SystemExit
buf = b"12345678abcd"
struct = uctypes.struct(
uctypes.addressof(buf),
{"f32": uctypes.UINT32 | 0, "f64": uctypes.UINT64 | 4},
Reported by Pylint.
Line: 1
Column: 1
# This test checks previously known problem values for 32-bit ports.
# It's less useful for 64-bit ports.
try:
import uctypes
except ImportError:
print("SKIP")
raise SystemExit
buf = b"12345678abcd"
Reported by Pylint.
Line: 9
Column: 1
print("SKIP")
raise SystemExit
buf = b"12345678abcd"
struct = uctypes.struct(
uctypes.addressof(buf),
{"f32": uctypes.UINT32 | 0, "f64": uctypes.UINT64 | 4},
uctypes.LITTLE_ENDIAN,
)
Reported by Pylint.
Line: 33
Column: 1
print("=")
buf = b"12345678abcd"
struct = uctypes.struct(
uctypes.addressof(buf),
{"f32": uctypes.UINT32 | 0, "f64": uctypes.UINT64 | 4},
uctypes.BIG_ENDIAN,
)
Reported by Pylint.
tests/extmod/uhashlib_sha256.py
4 issues
Line: 10
Column: 9
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
raise SystemExit
h = hashlib.sha256()
print(h.digest())
Reported by Pylint.
Line: 29
Column: 3
# 56 bytes is a boundary case in the algorithm
print(hashlib.sha256(b"\xff" * 56).digest())
# TODO: running .digest() several times in row is not supported()
# h = hashlib.sha256(b'123')
# print(h.digest())
# print(h.digest())
# TODO: partial digests are not supported
Reported by Pylint.
Line: 34
Column: 3
# print(h.digest())
# print(h.digest())
# TODO: partial digests are not supported
# h = hashlib.sha256(b'123')
# print(h.digest())
# h.update(b'456')
# print(h.digest())
Reported by Pylint.
Line: 1
Column: 1
try:
import uhashlib as hashlib
except ImportError:
try:
import hashlib
except ImportError:
# This is neither uPy, nor cPy, so must be uPy with
# uhashlib module disabled.
print("SKIP")
Reported by Pylint.
tests/extmod/ujson_loads.py
4 issues
Line: 8
Column: 9
import json
except ImportError:
print("SKIP")
raise SystemExit
def my_print(o):
if isinstance(o, dict):
print("sorted dict", sorted(o.items()))
Reported by Pylint.
Line: 1
Column: 1
try:
import ujson as json
except ImportError:
try:
import json
except ImportError:
print("SKIP")
raise SystemExit
Reported by Pylint.
Line: 11
Column: 1
raise SystemExit
def my_print(o):
if isinstance(o, dict):
print("sorted dict", sorted(o.items()))
else:
print(o)
Reported by Pylint.
Line: 11
Column: 1
raise SystemExit
def my_print(o):
if isinstance(o, dict):
print("sorted dict", sorted(o.items()))
else:
print(o)
Reported by Pylint.