Do not decode bytes in PPM error message by radarhere · Pull Request #8958 · python-pillow/Pillow

Skip to content

Navigation Menu

Sign in

Appearance settings

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Conversation

@radarhere

Copy link Copy Markdown

Member

Resolves #8956

msg = f"Token too long in file header: {token.decode()}"
raise ValueError(msg)

The issue found a token value that could not be decoded, so this PR changes the error message to use bytes instead.

@hugovk hugovk merged commit 36cea19 into python-pillow:main

Jun 10, 2025

55 checks passed

@radarhere radarhere deleted the ppm branch

June 10, 2025 11:30

@radarhere radarhere mentioned this pull request

Jun 13, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Unanticipated UnicodeDecodeError raised during call to PIL.Image.open

2 participants

@radarhere @hugovk