add accepts Infinity scores and writes records that immediately fail validation
I maintainer di solito rispondono entro 2 giorni
@vivek-3728 ci sta già lavorando.
Dal 29/10/2026.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 76/100
Direzione di ricerca
Inizia individuando l’analisi e la convalida di score e max_score nel comando add, poi confronta i suoi controlli con le regole numeriche del comando validate. Riproduci i comandi CLI forniti con un CSV temporaneo ed esamina i test pertinenti. Il risultato atteso è che add rifiuti i valori non finiti senza scrivere un record e che i record accettati superino validate.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 5
- Merge medio
- 1g 15h
- PR unite (30g)
- 27
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Nessuna guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di techcsispit/grade-tracker
-
feat: add cross-file integrity verification and repairForse già presa @deepmhatre13 l’ha presa oggi. Apertafeature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
techcsispit/grade-tracker#66 ·
I maintainer di solito rispondono entro 2 giorni
-
Blank credits pass validation but cause valid grade records to disappearForse già presa @vivek-3728 l’ha presa 9 giorni fa. Apertabug good first issue
techcsispit/grade-tracker#53 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di techcsispit/grade-tracker
Issue simili
-
enhancement help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Git-Hospital/githealthcheck#61 ·
I maintainer di solito rispondono entro 1 giorno
-
changelog investigate
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
ramnes/notion-sdk-py#433 ·
-
Partial method descriptors raise on class accessForse già presa @Gambit-Checkmate l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 19 giorni
-
docs pkg:core
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 84/100
pydantic/pydantic-ai#11929 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
intake/intake-esm#789 ·