Remote dataset loader leaks a temp file per cache=False fetch · Issue #2841 · microsoft/PyRIT · GitHub
Skip to content

Remote dataset loader leaks a temp file per cache=False fetch #2841

Closed

Description

what happens

the remote dataset loader leaks a full temp file on every cache=False fetch. _fetch_from_url writes the downloaded dataset into a NamedTemporaryFile(delete=False) and then abandons the handle without closing or deleting it, so each non-cached fetch strands a complete copy of the dataset in the temp directory.

this is the same bug class the maintainers already fixed for save_formatted_audio in #1894.

expected

the temp file is cleaned up when the fetch path is done with it (context-managed handle, or explicit close plus unlink in a finally), matching the #1894 fix pattern.

env: main 5503ecb

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