[Bug 718852] Re: PIL: write to file-compatible object fails

Chris Adams chris at improbable.org
Tue Jul 23 19:54:25 UTC 2013


This bug has been fixed in the more actively maintained Pillow fork of
PIL:

https://github.com/python-
imaging/Pillow/commit/197885164b22f82653af514e66c76f4b778c0b1b

-- 
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