Skip to content

Report invalid UTF-8 case manifests through CaseManifestError #688

Closed

Description

@LunaStev

Problem

load_case_manifest reads cases.toml as UTF-8 but catches only OSError and TOMLDecodeError. Invalid UTF-8 escapes as UnicodeDecodeError, bypassing the CLI's invalid case manifest diagnostic and exit status 2.

Starting points:

Reproduction

from pathlib import Path
from tempfile import TemporaryDirectory
from tools.case_manifest import load_case_manifest

with TemporaryDirectory() as directory:
    manifest = Path(directory) / "cases.toml"
    manifest.write_bytes(b"version = 2\n\xff")
    load_case_manifest(manifest)

Actual: an uncaught UnicodeDecodeError without the manifest path in its message.

Completion criteria

  • Convert manifest decoding failures into CaseManifestError, including the input path and useful decoding context.
  • The CLI reports the normal manifest diagnostic and exits 2 without a traceback.
  • Add temporary-file tests for invalid bytes and valid non-ASCII UTF-8 comments.
  • Preserve TOML syntax and filesystem error handling; do not use replacement decoding.

Difficulty: easy. This concerns the manifest reader; #584 fixed the separate Wave test-source metadata reader.

Activity

  1. added
    bug
    good first issue
    ci
    on Sep 22, 2026
  2. subikshajegadish commented on Sep 22, 2026

    @subikshajegadish
    Contributor

    hi, i'd like to work on this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugcigood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions