[BUG] CLI crashes with raw traceback on non-UTF-8 .dmai files

オープン
#27 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@xuu33030 がすでに取り組んでいます。

2026年9月18日 から。

  • #61 @xuu33030 による — オープン

評価

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

調査の方向性

Start in maithili_dsl/cli.py at run_dmai_file, where the file is read outside the try/except, and look at how existing errors print Maithili messages and pick exit codes. Wrap the read so a UnicodeDecodeError or OSError produces a friendly message and a non-zero exit. Done means a non-UTF-8 temp file in tests/test_cli.py gives the expected exit code with no traceback. Pull request #61 is already open against this issue, so check it before starting.

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

説明

area:cli bug good first issue P3

File: maithili_dsl/cli.py (run_dmai_file)

The file is read outside the try/except, so a .dmai file that is not valid UTF-8 crashes the CLI with a raw Python traceback instead of a friendly Maithili error:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte

(Verified against v0.3.0 with a UTF-16-encoded file.)

Fix: wrap the read in try/except (UnicodeDecodeError, OSError), print a Maithili error message (see existing style, e.g. ⚠️ त्रुटि: फाइल UTF-8 में नहि अछि।), and return a non-zero exit code (reuse EXIT_NOT_FOUND or add EXIT_BAD_ENCODING = 7 and document it).

Tests: tests/test_cli.py — write a non-UTF8 temp file, assert exit code and no traceback.

Good first issue: small, contained, and a nice tour of the CLI error-handling style.

主要言語
Python
スター
1
フォーク
4
平均マージ
12日 21時間
マージ済み PR(30日)
1

環境構築

はじめの一歩

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

alphacrack/python-maithili-dsl のほかの issue

alphacrack/python-maithili-dsl の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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