Skip to content

fix: hygiene extras crashes on Python 3.10 (no tomllib) #581

Closed

Description

@Jammy2211

Overview

pyauto-brain hygiene (default scan and hygiene extras) crashes with ModuleNotFoundError: No module named 'tomllib'. hygiene.sh runs _hygiene_extras.py with the bare python3, which is 3.10 on the WSL laptop, and tomllib arrived in Python 3.11. Brain CI tests on 3.12 and 3.13, so CI never sees it. The extras mode has been silently empty on the laptop as a result. Found 2026-11-04 in the health and hygiene review.

Plan

  • hygiene.sh runs the extras helper with the newest available interpreter (python3.13, python3.12, python3.11, then python3).
  • _hygiene_extras.py falls back to tomli when present. With neither, it prints a one-line "skipped: needs Python ≥ 3.11" row and exits cleanly, not with a traceback.
  • Add a test for the no-tomllib path.
  • Tier: glance — merge mode: human /prm
Detailed implementation plan
  • agents/conductors/hygiene/hygiene.sh: add _toml_python(), which echoes the first of python3.13/3.12/3.11 found by command -v, else python3. Use it at the two _hygiene_extras.py call sites and in helper_row for extras.
  • _hygiene_extras.py: replace import tomllib with try tomllib / except: try tomli / except: tomllib = None. With tomllib is None, main emits the skipped row and exits 0.
  • Test: run the helper's import path with tomllib masked from sys.modules, and assert the skipped message is printed and nothing is raised.

Activity

  1. Jammy2211 commented on Nov 4, 2026

    @Jammy2211
    ContributorAuthor

    Shipped in #582 (merged, CI green 2/2): extras runs on the newest python3.1x with tomllib; without one it reports a skipped/advisory row instead of a traceback.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions