[Bug 718852] Re: PIL: write to file-compatible object fails
Launchpad Bug Tracker
718852 at bugs.launchpad.net
Tue Aug 14 14:41:30 UTC 2012
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: python-imaging (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to python-imaging in Ubuntu.
https://bugs.launchpad.net/bugs/718852
Title:
PIL: write to file-compatible object fails
Status in “python-imaging” package in Ubuntu:
Confirmed
Bug description:
Binary package hint: python-imaging
>>> import io, PIL.Image
>>> img = PIL.Image.new("RGB",(10,10))
>>> stream = io.BytesIO()
>>> img.save(stream,"PPM")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1439, in save
save_handler(self, fp, filename)
File "/usr/lib/python2.6/dist-packages/PIL/PpmImagePlugin.py", line 118, in _save
ImageFile._save(im, fp, [("raw", (0,0)+im.size, 0, (rawmode, 0, 1))])
File "/usr/lib/python2.6/dist-packages/PIL/ImageFile.py", line 476, in _save
fh = fp.fileno()
File "/usr/lib/python2.6/io.py", line 480, in fileno
self._unsupported("fileno")
File "/usr/lib/python2.6/io.py", line 333, in _unsupported
(self.__class__.__name__, name))
io.UnsupportedOperation: BytesIO.fileno() not supported
This is due to line 478 in ImageFile.py, where they rely on an
AttributeError to be raised instead of io.UnsupportedOperation.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-imaging/+bug/718852/+subscriptions
More information about the foundations-bugs
mailing list