cursor.execute(stmt, (tracker_id,))
for row in cursor:
- (info_hash,) = row
+ (info_hash_mem,) = row
+ info_hash = bytes(info_hash_mem)
assert len(info_hash) == 20
- yield bytes(info_hash)
+ yield info_hash
def insert_swarm_info(self, tracker_id: int, infos: Iterable["disk_jumble.scrape.ScrapeInfo"]) -> None:
stmt = """
rows = list(rows_iter)
[(slab_id, disk_id, sectors_pg, entity_id, entity_off, key)] = {r[:6] for r in rows}
sectors = range(sectors_pg.lower, sectors_pg.upper)
- slab = Slab(slab_id, disk_id, sectors, entity_id, entity_off, key)
+ slab = Slab(slab_id, disk_id, sectors, bytes(entity_id), entity_off, key)
# `None' if no hasher match in outer join, otherwise earliest match
(*_, id_, seq, end_off, state) = min(rows, key = lambda r: r[-2])