You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a tiff file (e.g. from pylab import *; savefig("test.tiff") using matplotlib).
Try to load it with Pillow, passing the path as pathlib.Path: from PIL import Image; from pathlib import Path; Image.open(Path("test.tiff")).tobytes()
What did you expect to happen?
The image is correctly loaded (the same as Image.open("test.tiff").tobytes(); using a pathlib.Path also works just fine on Linux).
What actually happened?
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "...\Miniconda3\lib\site-packages\PIL\Image.py", line 746, in tobytes
self.load()
File "...\Miniconda3\lib\site-packages\PIL\TiffImagePlugin.py", line 1078, in load
return super(TiffImageFile, self).load()
File "...\Miniconda3\lib\site-packages\PIL\ImageFile.py", line 177, in load
self.map = Image.core.map(self.filename)
TypeError: argument 1 must be str, not WindowsPath
What are your OS, Python and Pillow versions?
OS: Windows 10
Python: 3.7
Pillow: 6.0.0
The text was updated successfully, but these errors were encountered:
I wasn't able to replicate this on AppVeyor. I don't suppose you could say if you're only experiencing this on Windows 10, and not Windows 7?
Also, while you would think this should be easy to reproduce in the right environment, could you provide a script from start to end, attaching a file if necessary, without matplotlib?
What did you do?
from pylab import *; savefig("test.tiff")
using matplotlib).from PIL import Image; from pathlib import Path; Image.open(Path("test.tiff")).tobytes()
What did you expect to happen?
The image is correctly loaded (the same as
Image.open("test.tiff").tobytes()
; using a pathlib.Path also works just fine on Linux).What actually happened?
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: