FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Pass file handle to ContainerIO by radarhere · Pull Request #8625 · python-pillow/Pillow · GitHub

Pass file handle to ContainerIO - #8625

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:containerio
Dec 27, 2024
Merged

Pass file handle to ContainerIO#8625
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:containerio

Conversation

Copy link
Copy Markdown
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 merged commit d008d12 into python-pillow:main Dec 27, 2024
radarhere deleted the containerio branch December 27, 2024 19:52
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL