-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
It looks like something in Pillow 11.2 introduced an issue similar to this: #8472. This time with the filename attribute.
What did you do?
import pickle
from io import BytesIO
from PIL import Image
im = Image.open("anyimage.jpg")
p = pickle.dumps(im)
im = pickle.loads(p)
# Fails in 11.2, works in 11.1
output = BytesIO()
im.save(output, format=im.format, quality="keep")What did you expect to happen?
The code above to work.
What actually happened?
Traceback (most recent call last):
File "test.py", line 14, in <module>
im.save(output, format=im.format, quality="keep")
File "/local/lib64/python3.9/site-packages/PIL/Image.py", line 2546, in save
if isinstance(self, ImageFile.ImageFile) and filename == self.filename:
File "/local/lib64/python3.9/site-packages/PIL/JpegImagePlugin.py", line 400, in __getattr__
raise AttributeError(name)
AttributeError: filenameWhat are your OS, Python and Pillow versions?
- OS: Linux
- Python: Python 3.9
- Pillow: 11.2
albertvillanova
Metadata
Metadata
Assignees
Labels
No labels