fix: define missing exit code and fix list deletion during iteration#106
Merged
Conversation
EC_OUTPUT_WRITE_FAIL was used on the output file write error path but never defined, causing a NameError instead of a clean exit with a meaningful code. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
del obj[set_idx] inside for set_idx in range(0, len(obj)) shrinks the list while the index advances, causing elements after a deleted one to be skipped and potential IndexError at the end. Replace with a filter-and-collect pattern that builds a new list, avoiding mutation during iteration. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
|
@rafaelfolco Do these bug fixes seem reasonable to you? |
rafaelfolco
approved these changes
Jun 29, 2026
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.
Summary
Two fixes, one per commit:
Define
EC_OUTPUT_WRITE_FAIL: Used on the output file write error path but never defined. CausedNameErrorinstead of a clean exit with code 7.Fix
sanitize_setlist mutation during iteration:del obj[set_idx]insidefor set_idx in range(0, len(obj))skips elements after a deletion and risksIndexError. Replaced with a filter-and-collect pattern that builds a new list.Closes #104
Test plan
PYTHONPATH=. pytest tests/ -v)sanitize_setpreserves the same filtering and role-defaulting behavior🤖 Generated with Claude Code