Repository navigation
Conversation
The --dump branch applied .format(h) to the Redis result instead of the
key, so it queried the literal key '{}:eids' and then called .format on
the returned set, raising AttributeError on the first hash. Build the
key the same way line 86 does when writing it.
The following line also concatenated a list with the set returned by
smembers, raising TypeError. Sort the event IDs into a list so
writerow receives one sequence and the CSV output is deterministic.
Both defects were on the same path, so --dump had never worked.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BLUF
./correlator.py --dumphas never worked — it crashes on the first hash..format(), and alist + setconcatenation.grouping/correlator.py; no other behaviour, dependency or interface changes.redis/pydeep/Cryptofaked:AttributeErrorbefore, a correct CSV row after.What was wrong
In the
--dumpbranch the.format(h)call was attached to the Redis result instead of the key string:So Redis was queried for the literal key
'{}:eids', which is never written — line 86 correctly writesr.sadd('{}:eids'.format(h), *eids)— and.formatwas then called on the returned set.The next line then concatenated a list with a set:
Concrete impact
./correlator.py --dumpaborts on the very first hash withAttributeError: 'set' object has no attribute 'format'. redis-py returns aseteven for a missing key, so it fails regardless of the database contents.TypeError: can only concatenate list (not "set") to list.What this changes
grouping/correlator.py, two lines:The first change restores the same key-building idiom already used at line 86. The second turns the set into a list so
writerowreceives a single sequence;sortedrather thanlistalso makes the CSV output deterministic between runs.Nothing else is touched — no refactoring, no reformatting, no dependency changes.
How it was verified
A throwaway harness (see the check below) stubs out
redis,pydeep,Crypto.HashandSafeConfigParser, seeds a fake Redis withhashes_md5={'aaa'},hashes_sha1={'bbb'},aaa:eids={'42','7'},bbb:eids=set(), and runsgrouping/correlator.py --dump:AttributeError: 'set' object has no attribute 'format'aaa,42,7—bbbcorrectly suppressed by the existingif eids:guard.The repository-wide syntax gate (
bash -n hashes-extract.shplus anast.parsesweep over all tracked*.py) is unchanged by this patch: the same four pre-existing Python 2 files fail before and after, andgrouping/correlator.pyis not among them.Local verification
Output: