Steps to reproduce:
>>> from PIL import Image
>>> f = open(".wallpaper.jpg")
>>> img = Image.open(f)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.4/site-packages/PIL/Image.py", line 2256, in open
prefix = fp.read(16)
File "/usr/lib64/python3.4/codecs.py", line 319, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xff in position 0: invalid start byte
PILLOW_VERSION = '3.0.0'
VERSION = '1.1.7'
Affects a few images tested.
Works fine in python2 and I've tried reinstalling python3-pillow from package manager (dnf, fedora 23).
Anything I can do to help debug?
Image attached, just in case.

Possibly related, I get the following error if I try to install with pip or pip3:
ValueError: --enable-jpeg requested but jpeg not found, aborting.
I have openjpeg-devel and turbojpeg-devel installed. Not sure what it wants.
Unrelated, just needed libjpeg-turbo-devel (of course).
Nope: unrelated. Tested with pip3 pillow and I get the same error.
You need to open the file in binary mode:
>>> from PIL import Image
>>> f = open(".wallpaper.jpg", 'rb')
>>> img = Image.open(f)
On Sun, Dec 27, 2015 at 03:30:37AM -0800, wiredfool wrote:
You need to open the file in binary mode:
Thanks!
Thanks a lot for your answer @wiredfool
Saved my day
Thanks a lot @wiredfool!
Most helpful comment
You need to open the file in binary mode: