Skip to content

build_subsets.py and build_data.py still write with unclosed handles, and no script writes atomically #118

Description

@realmarcin

From the review of #106 and #108.

#106 fixed the one json.dump(f(), open(p, "w")) where evaluation order was load-bearing. The remaining writes in build_subsets.py (every edge and cell file, plus subsets_summary.json) and the census still use json.dump(doc, open(...)) without closing the handle. There is no truncation risk there because the document is built first, but every run emits ResourceWarnings, and an interrupted write can still leave a partial file in assets/fleet/ that assemble_page.py --check will not notice.

#106 explicitly deferred the stronger fix: write to a temporary file and rename, across the four scripts that write derived data. This records that deferral so it is not lost.

Activity

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