mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-25 17:36:18 +03:00
Merge pull request #6239 from radarhere/ppm_token
Decode bytes before passing to f-string
This commit is contained in:
commit
42a81c4173
|
@ -123,7 +123,7 @@ def test_token_too_long(tmp_path):
|
|||
with Image.open(path):
|
||||
pass
|
||||
|
||||
assert str(e.value) == "Token too long in file header: b'01234567890'"
|
||||
assert str(e.value) == "Token too long in file header: 01234567890"
|
||||
|
||||
|
||||
def test_truncated_file(tmp_path):
|
||||
|
|
|
@ -83,7 +83,7 @@ class PpmImageFile(ImageFile.ImageFile):
|
|||
# Token was not even 1 byte
|
||||
raise ValueError("Reached EOF while reading header")
|
||||
elif len(token) > 10:
|
||||
raise ValueError(f"Token too long in file header: {token}")
|
||||
raise ValueError(f"Token too long in file header: {token.decode()}")
|
||||
return token
|
||||
|
||||
def _open(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user