Closed mimre25 closed 5 months ago
I have an example for a false positive (I hope), if it's desired. Setup. A CSV file as input with the first item in each row being an index number.
id_pos = 0
# lf is LogFile not LazyFrame
lf = self._logger
with self.rlock:
lf.seek(0, 0)
cpos = lf.tell()
for line in lf:
if len(line.strip()) == 0:
continue
sl = line.split(b",", 1)
self._mapper[sl[id_pos]] = cpos
cpos = lf.tell()
Desired behavior is to find all indexes and record the file position where they start. This just started getting flagged, which led me here. There are 4 more flags in the same file, tell() seek() x2 write()
@sahuagin thanks for the report, #453 should fix this.
This implements a POC for #445.
I opted to go the route of alerting for any mutations of a loop iterator.
Note: I picked B999 temporarily, not sure how the numbers are picked. Also, I'm very much open to change the error message.
Would be happy if you could give this a review @cooperlees :slightly_smiling_face: