1 SUSPECT #1
from pathlib import Path
Path("/tmp/definitely_not_here_xyz").rmdir() Traceback (most recent call last):
File "lineup.py", line 2, in <module>
Path("/tmp/definitely_not_here_xyz").rmdir()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/definitely_not_here_xyz' 2 SUSPECT #2
import gzip
with open("/tmp/plain.txt", "wb") as f:
f.write(b"not gzipped")
gzip.open("/tmp/plain.txt").read() Traceback (most recent call last):
File "lineup.py", line 4, in <module>
gzip.open("/tmp/plain.txt").read()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
gzip.BadGzipFile: Not a gzipped file (b'no') 3 SUSPECT #3
import struct
struct.pack("i", "not int") Traceback (most recent call last):
File "lineup.py", line 2, in <module>
struct.pack("i", "not int")
~~~~~~~~~~~^^^^^^^^^^^^^^^^
struct.error: required argument is not an integer 4 SUSPECT #4
from dataclasses import dataclass
@dataclass(eq=False, frozen=True)
class P:
x: int
p = P(1)
p.x = 99 Traceback (most recent call last):
File "lineup.py", line 8, in <module>
p.x = 99
^^^^^^^^
dataclasses.FrozenInstanceError: cannot assign to field 'x' 5 SUSPECT #5
import heapq
print(heapq.nsmallest(2, {"b": 5, "a": 3})) Traceback (most recent call last):
File "lineup.py", line 2, in <module>
print(heapq.nsmallest(2, {"b": 5, "a": 3}))
~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'heap key lookup on dict'