Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

add accepts Infinity scores and writes records that immediately fail validation

Abierto Apto para principiantes
#69 1 comentario 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@vivek-3728 ya está trabajando en esto.

Desde el 29/10/2026.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
76/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python
Área
cli

Línea de trabajo

Empieza por localizar el análisis y la validación de score y max_score en el comando add; después, compara sus comprobaciones con las reglas numéricas del comando validate. Reproduce los comandos CLI proporcionados con un CSV temporal y revisa las pruebas pertinentes. El objetivo es que add rechace valores no finitos sin escribir un registro y que los registros aceptados superen validate.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
0
Forks
5
Merge medio
1 d 15 h
PR fusionados (30 d)
27

Preparar el entorno

  • Sin Dockerfile ni archivo de Docker Compose
  • Tiene una plantilla de pull request
  • Sin guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de techcsispit/grade-tracker

Todos los issues de techcsispit/grade-tracker

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.