Skip to content

Move workflow_reuse.py fetch onto audit.contents_text #3106

Closed

Description

@ptr727

spec/audit.py now has contents_text(content), the one decoder for a GitHub contents API response: it returns the decoded text, or None where the response holds no inline base64 content, a directory listing or a too-large file among them.

spec/workflow_reuse.py fetch (around line 73) still decodes the response itself, with its own encoding != "base64" check and base64.b64decode(...).decode("utf-8", "replace"). Move it onto audit.contents_text, as spec/fidelity_honesty.py fetch already is, so a later change to the decode is made once.

Found while driving the pull request that added the helper, which moved every such site in the files it touched.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions