Symptom
Process Killed (exit 137). Looks like out-of-memory.
Cause
while cand in seen:
cand = f"{cand} {i}"[:99]
If the name is already 99 characters, truncation means the value never changes → loops forever. Measured memory was 36MB. The cause was a CPU-bound infinite loop.
Fix
_t < 20)Every piece of code that uniquifies by appending a suffix (SKU, filename, item name) has this shape.
Verification
Don't assume Killed is memory. Measure with ru_maxrss.