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

Fixed BytesWarnings #6816

Merged
merged 1 commit into from Dec 21, 2022
Merged

Fixed BytesWarnings #6816

merged 1 commit into from Dec 21, 2022

Conversation

radarhere
Copy link
Member

https://github.com/python-pillow/Pillow/actions/runs/3745012260/jobs/6358985335#step:8:4128

Tests/test_file_ppm.py::test_plain_invalid_data[P1\n128 128\n1009]
/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/PIL/PpmImagePlugin.py:211: BytesWarning: str() on a bytes instance
raise ValueError(f"Invalid token for this mode: {bytes([token])}")

Tests/test_file_ppm.py::test_plain_ppm_token_too_long[P3\n128 128\n255\n012345678910]
/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/PIL/PpmImagePlugin.py:245: BytesWarning: str() on a bytes instance
f"Token too long found in data: {half_token[:max_len + 1]}"

Tests/test_file_ppm.py::test_plain_ppm_token_too_long[P3\n128 128\n255\n012345678910 0]
/opt/hostedtoolcache/Python/3.11.1/x64/lib/python3.11/site-packages/PIL/PpmImagePlugin.py:251: BytesWarning: str() on a bytes instance
f"Token too long found in data: {token[:max_len + 1]}"

This PR fixes these BytesWarnings by changing the entire error messages to bytes.

@hugovk hugovk merged commit 2f3561f into python-pillow:main Dec 21, 2022
@radarhere radarhere deleted the warning branch December 21, 2022 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants