Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass file handle to ContainerIO #8625

Merged
merged 1 commit into from
Dec 27, 2024
Merged

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