add accepts Infinity scores and writes records that immediately fail validation
Maintainer antworten meist innerhalb von 2 Tagen
@vivek-3728 arbeitet bereits daran.
Seit 01.11.2026.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 76/100
Rechercherichtung
Beginne damit, das Parsen und die Validierung von score und max_score im Befehl add zu finden, und vergleiche dann dessen Prüfungen mit den numerischen Regeln des Befehls validate. Führe die angegebenen CLI-Befehle mit einer temporären CSV-Datei aus und sieh dir die relevanten Tests an. Ziel ist, dass add nicht endliche Werte zurückweist, ohne einen Datensatz zu schreiben, und dass akzeptierte Datensätze validate bestehen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
I found a bug where the add command accepts inf as both the score and maximum score, even though these are not valid numeric grades.
The command reports success and writes the record to the CSV, but running validate immediately afterward rejects the same record.
This means a normal add operation can turn an otherwise valid grade file into one that fails the application's own validation.
Steps to Reproduce
Run:
python -m grade_tracker --data grades.csv add S1 Math inf inf 2026-10-30 3 1
python -m grade_tracker --data grades.csv validate
Actual Behavior
The add command reports:
Added grade for S1 in Math.
The CSV now contains:
S1,Math,inf,inf,2026-10-30,3.0,1
However, validation reports:
Error: row 2, field score: 'inf' is not a numeric score
Error: row 2, field max_score: 'inf' is not a numeric maximum score
Validation failed: 2 problems found.
Expected Behavior
The add command should reject non-finite values before writing anything to the CSV.
Any record successfully added through the CLI should also pass the application's numeric validation rules.
Likely Cause
The add command relies on numeric range comparisons without explicitly checking whether the values are finite.
Since Python evaluates float("inf") <= float("inf") as True, the invalid values pass the existing checks.
The validation command applies stricter numeric rules and correctly rejects them.
Using math.isfinite() for both score and max_score would prevent Infinity and NaN values from being accepted.
Impact
A successful CLI operation can introduce invalid grade records into an otherwise valid CSV file.
This creates inconsistent behavior between add and validate and may affect subsequent calculations, reporting, or exports.
The issue was reproduced on the latest upstream/main and no matching report was found among the 68 open and closed issues and PRs checked.
- Vorherrschende Sprache
- Python
- Sterne
- 0
- Forks
- 5
- Ø Merge
- 1 T. 15 Std.
- Gemergte PRs (30 T.)
- 27
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus techcsispit/grade-tracker
-
feat: add cross-file integrity verification and repairEvtl. vergeben @deepmhatre13 hat das vor 3 Tagen übernommen. Offenfeature
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 35/100
techcsispit/grade-tracker#66 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Blank credits pass validation but cause valid grade records to disappearEvtl. vergeben @vivek-3728 hat das vor 12 Tagen übernommen. Offenbug good first issue
techcsispit/grade-tracker#53 · 1 Kommentar · 1 zugewiesene Person ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in techcsispit/grade-tracker
Ähnliche Issues
-
breaking change
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
check-skill-pages: show fixture build errors when a build failsEvtl. vergeben @ShahadatTest hat das heute übernommen. Offengood first issue P2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
coco-research/coco#439 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
esphome/home-assistant-addon#274 ·
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
endurain-project/endurain#882 ·
Maintainer antworten meist innerhalb von 1 Tag
-
good first issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100