#16640: Graphics3d.show abuses graphics_filename
------------------------+----------------------------
Reporter: gagern | Owner:
Type: defect | Status: new
Priority: major | Milestone: sage-6.3
Component: graphics | Keywords:
Merged in: | Authors:
Reviewers: | Report Upstream: N/A
Work issues: | Branch:
Commit: | Dependencies:
Stopgaps: |
------------------------+----------------------------
Code in
[http://git.sagemath.org/sage.git/tree/src/sage/plot/plot3d/base.pyx?id=6.3.beta1#n1131
sage/plot/plot3d/base.pyx] in the method `Graphics3d.show()` makes invalid
use of `graphics_filename`: it generates a name (like `sage0.png`), then
strips the extension and appends various other extensions during the
course of the method. But `graphics_filename` makes no guarantees that
these other file names will be unused. In fact chances are pretty good
that these files already exist from a different run of that method inside
the same cell. So we get clashes there. Perhaps if things change in other
places we might even get a security issue due to a race condition here.
I can think of two possible approaches: either call `graphics_filename` in
several places, once for every file name we need to generate. Or create a
temporary directory and write all files inside that with fixed names. The
former will likely be easier to handle for notebook, but may make the code
harder to read. Particularly those cases where some tool will use one file
name to derive another file name might be a real pain, like when the
applet size is encoded in the file name, or the magic aroud the
`archive_name` for jmol. Will need some good interactive testing to make
sure that everything still works after these changes.
--
Ticket URL: <http://trac.sagemath.org/ticket/16640>
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.