File "rep.py", line 6, in <module>
PIL.Image.open(d)
File "lib/python3.10/site-packages/PIL/Image.py", line 3551, in open
im = _open_core(fp, filename, prefix, formats)
File "lib/python3.10/site-packages/PIL/Image.py", line 3539, in _open_core
im = factory(fp, filename)
File "lib/python3.10/site-packages/PIL/ImageFile.py", line 147, in __init__
self._open()
File "/lib/python3.10/site-packages/PIL/PpmImagePlugin.py", line 119, in _open
self._size = int(self._read_token()), int(self._read_token())
File "lib/python3.10/site-packages/PIL/PpmImagePlugin.py", line 97, in _read_token
msg = f"Token too long in file header: {token.decode()}"
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xee in position 10: unexpected end of data
When the below code is run, a
UnicodeDecodeErroris raised when attempting to raise aValueErrorwith a descriptive message to the user. This occurs in_read_tokenat line 97 in PpmImagePlugin.py.Minimal Reproducer
Version Info
11.2.1Traceback Report