[issue9383] PIL Bug with split

Arrnaud Fabre report at bugs.python.org
Mon Jul 26 17:08:32 CEST 2010

New submission from Arrnaud Fabre <arnaud333 at gmail.com>:

>>> import Image
>>> im = Image.open('whatever')
>>> im.split()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1497, in split
    if self.im.bands == 1:
AttributeError: 'NoneType' object has no attribute 'bands'

Bug can be fixed by using getdata before split() :

>>> import Image
>>> im = Image.open('whatever')
>>> im.getdata()
<ImagingCore object at 0x7fad913c0090>
>>> im.split()
(<Image.Image image mode=L size=360x480 at 0x1CAE320>, <Image.Image image mode=L size=360x480 at 0x1CAE368>, <Image.Image image mode=L size=360x480 at 0x1CAE3B0>)

messages: 111630
nosy: Arrnaud.Fabre
priority: normal
severity: normal
status: open
title: PIL Bug with split
type: crash
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list