Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

add accepts Infinity scores and writes records that immediately fail validation

オープン 初心者向け
#69 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

@vivek-3728 がすでに取り組んでいます。

2026年10月29日 から。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
76/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli

調査の方向性

まず、コマンド add における score と max_score の解析および検証を見つけ、そのチェックをコマンド validate の数値規則と比較します。提示された CLI コマンドを一時的な CSV で再現し、関連するテストを確認します。完了条件は、add がレコードを書き込まずに有限でない値を拒否し、受け入れられたレコードが validate に合格することです。

索引モデルが issue の本文から書いたものです。

説明

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.

主要言語
Python
スター
0
フォーク
5
平均マージ
1日 15時間
マージ済み PR(30日)
27

環境構築

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

techcsispit/grade-tracker のほかの issue

techcsispit/grade-tracker の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。