Skip to content

Feature: accept any buffer input in the file preparation APIs #46

@ncoghlan

Description

@ncoghlan

(Note: this covers both the file and image preparation APIs)

The various prepare_file and prepare_image methods and functions currently accept the following input types:

  • str (filesystem path)
  • os.PathLike[str] (filesystem path)
  • bytes (raw file content)
  • BinaryIO (raw file content)

Rather than only accepting bytes, the file and image preparation APIs should use typing_extensions.Buffer to indicate they accept any type implementing the buffer protocol (using memoryview to extract the raw file content from such types, replacing the current dedicated bytes handling).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions