Skip to content

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.

2 participants