Title: PIL Bug with split
Type: behavior Stage: resolved
Components: Versions: Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: Arrnaud.Fabre, ezio.melotti
Priority: normal Keywords:

Created on 2010-07-26 15:08 by Arrnaud.Fabre, last changed 2010-07-26 15:10 by ezio.melotti. This issue is now closed.

Messages (2)
msg111630 - (view) Author: Arrnaud Fabre (Arrnaud.Fabre) Date: 2010-07-26 15:08
>>> import Image
>>> im ='whatever')
>>> im.split()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/PIL/", line 1497, in split
    if == 1:
AttributeError: 'NoneType' object has no attribute 'bands'

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

>>> import Image
>>> im ='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>)
msg111633 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-07-26 15:10
You should report this on the PIL bug tracker. PIL is not part of the Python standard library.
Date User Action Args
2010-07-26 15:10:26ezio.melottisetstatus: open -> closed

type: crash -> behavior

nosy: + ezio.melotti
messages: + msg111633
resolution: not a bug
stage: resolved
2010-07-26 15:08:30Arrnaud.Fabrecreate