Skip to content

Conversation

@radarhere
Copy link
Member

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

#7656 set ContainerIO to receive IO as the type of the first argument.

def __init__(self, file: IO[AnyStr], offset: int, length: int) -> None:

Currently, test_file_container.py passes an image instance to it sometimes - the wrong type.

with hopper() as im:
container = ContainerIO.ContainerIO(im, 0, 0)

This PR fixes that, passing a file handle to it like the rest of the test file does.

with open(TEST_FILE, "rb") as fh:
container = ContainerIO.ContainerIO(fh, 22, 100)

@hugovk hugovk merged commit d008d12 into python-pillow:main Dec 27, 2024
48 checks passed
@radarhere radarhere deleted the containerio branch December 27, 2024 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants