#17940: IOError: cannot identify image file
------------------------------+----------------------------
   Reporter:  gagern          |            Owner:
       Type:  defect          |           Status:  new
   Priority:  major           |        Milestone:  sage-6.6
  Component:  user interface  |         Keywords:
  Merged in:                  |          Authors:
  Reviewers:                  |  Report Upstream:  N/A
Work issues:                  |           Branch:
     Commit:                  |     Dependencies:
   Stopgaps:                  |
------------------------------+----------------------------
 With Sage 6.6 beta 3 and using Sage Notebook I get a backtrace when I want
 to see a sphere:

 {{{
 sage: sphere()
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "_sage_input_3.py", line 10, in <module>
     exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8
 -*-\\n" +
 
_support_.preparse_worksheet_cell(base64.b64decode("c3BoZXJlKCk="),globals())+"\\n");
 execfile(os.path.abspath("___code___.py"))
   File "", line 1, in <module>

   File "/tmp/tmpWqCNEl/___code___.py", line 2, in <module>
     exec compile(u'sphere()
   File "", line 1, in <module>

   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/display_manager.py", line 716, in
 displayhook
     return self._backend.displayhook(plain_text, rich_output)
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_base.py", line 432, in displayhook
     return self.display_immediately(plain_text, rich_output)
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_sagenb.py", line 361, in
 display_immediately
     rich_output.embed()
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_sagenb.py", line 258, in embed
     self.save_preview()
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_sagenb.py", line 237, in
 save_preview
     self.preview_png.save_as(self.preview_filename())
   File "sage/misc/cachefunc.pyx", line 2209, in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (build/cythonized/sage/misc/cachefunc.c:13699)
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_sagenb.py", line 189, in
 preview_filename
     directory, filename = os.path.split(self._base_filename())
   File "sage/misc/cachefunc.pyx", line 2209, in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (build/cythonized/sage/misc/cachefunc.c:13699)
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_sagenb.py", line 147, in
 _base_filename
     filename = self.sagenb_launch_script_filename()
   File "sage/misc/cachefunc.pyx", line 2209, in
 sage.misc.cachefunc.CachedMethodCallerNoArgs.__call__
 (build/cythonized/sage/misc/cachefunc.c:13699)
   File "sage/local/lib/python2.7/site-
 packages/sage/repl/rich_output/backend_sagenb.py", line 122, in
 sagenb_launch_script_filename
     width, height = PIL.Image.open(StringIO(self.preview_png.get())).size
   File "build/bdist.linux-x86_64/egg/PIL/Image.py", line 2006, in open
 IOError: cannot identify image file
 }}}

 Using strace I can see access to some `preview.png` and looking at that
 file I notice that it appears to be a regular PNG, concatenated with a
 Jmol script. So apparently two outputs ended up in the same data stream.
 This is likely a consequence of #17234.

--
Ticket URL: <http://trac.sagemath.org/ticket/17940>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to