Skip to content

Remove write method from test#9806

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:write
Jul 21, 2026
Merged

Remove write method from test#9806
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:write

Conversation

@radarhere

Copy link
Copy Markdown
Member

Extracted from #9803

Pillow/Tests/test_image.py

Lines 197 to 209 in 8f86212

class FP(io.BytesIO):
name: Path
if sys.version_info >= (3, 12):
from collections.abc import Buffer
def write(self, data: Buffer) -> int:
return len(data)
else:
def write(self, data: Any) -> int:
return len(data)

The write method was originally added in #2227. I guess it became redundant after #8163 changed FP to inherit from io.BytesIO.

Co-authored-by: Aarni Koskela <akx@iki.fi>

@akx akx left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like an excellent change, if I do say so myself! 😁

@hugovk hugovk changed the title Remove write method Remove write method from test Jul 21, 2026
@hugovk
hugovk merged commit e7a7ea8 into python-pillow:main Jul 21, 2026
49 checks passed
@radarhere
radarhere deleted the write branch July 21, 2026 11:41
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.

3 participants