Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #16640: Graphics3d.show abuses graphics_filename
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. URL: http://trac.sagemath.org/16640 Reported by: gagern Ticket author(s): Martin von Gagern, Jeroen Demeyer Reviewer(s): Jeroen Demeyer, Karl-Dieter Crisman
- Loading branch information
Showing
6 changed files
with
84 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters