-
-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix remaining temporary filename issues (like in animate.py) #13807
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
In Sage-5.5.rc0:
Ignoring c files, that means we need to fix
Huh, that's more than I was expecting. Anyway, it's seven files. I'm making this a 5.5 blocker because of the bug when |
comment:4
The file sage/misc/misc.py has a line
so I think that
and it seems to work fine. So I think we only need to fix the diff --git a/sage/misc/misc.py b/sage/misc/misc.py
--- a/sage/misc/misc.py
+++ b/sage/misc/misc.py
@@ -39,7 +39,7 @@ import operator, os, stat, socket, sys,
import sage.misc.prandom as random
from lazy_string import lazy_string
-from sage.misc.temporary_file import tmp_dir, tmp_filename, delete_tmpfiles
+from sage.misc.temporary_file import tmp_dir, tmp_filename, delete_tmpfiles, graphics_filename
from banner import version, banner
But it's also not much harder (I think) to fix each individual use of |
Author: John Palmieri |
comment:5
I was wondering about this, but since this was broken I figured it was all broken... sorry for that wasted time.
Agreed. This patch is fine, modulo the next comment. This could have been caught if we had a way to enable this currently untested doctest. The same problem in the matrix file - it's precisely when we don't pass in the filename that this branch of the code happens... sigh. Of course, that function is completely untested. Can you think of any way to get around that and add a doctest to this patch, or is it hopeless without doing some pointless refactoring of code? William is very clear about not wanting to leave random files around... maybe we could at least doctest the matrix one and then remove that file? We've tried to get away from ad hoc file creation and removal, but in this case I think that's the only way to do it right. Incidentally, ran into the |
comment:6
Attachment: trac_13807_graphics_filename.patch.gz I've added a doctest (not a perfect one, but the best I can think of) in matrix_modn_sparse.pyx. I don't think it's possible to add a doctest to animate.py, since those require ImageMagick or similar to run. For the |
comment:7
This makes sense, but unfortunately it doesn't actually show up in the notebook. In fact, even at the command line it shows up in the current working directory, which is not standard Sage behavior for graphics, though it is the documented behavior. My personal preference would be to have it changed, but that wouldn't be this ticket. What do you think the "right" behavior should be for the notebook and Actually, this must be a really old function, since
Sounds reasonable, as I suspected but hoped against. Sorry about asking the matrix notebook question. I hate it when we discover bugs or unneeded functionality when trying to do very routine fixes. I'd be tempted to just can the function entirely, except there's the deprecation period and we should probably ask Martin if it's needed... Random annoyance this has nothing to do with.
Are these actual unused branches or is the compiler just blowing off steam? Anyway, not worrisome here.
Yes, I just couldn't remember the ticket numbers, I wasn't actually complaining. |
comment:8
It looks like I have no idea about those warnings about unreachable code, by the way. |
comment:9
Okay, sounds good enough. I'll open a new ticket to ask about this other stuff for |
Reviewer: Karl-Dieter Crisman |
comment:10
That is now #13812. Patchbot, apply trac_13807_graphics_filename.patch |
This comment has been minimized.
This comment has been minimized.
Merged: sage-5.5.rc1 |
In #13579, for security reasons and modularity, we moved temporary filename constructors from
sage.misc.misc
to their own module. Most things were moved with it, but a couple places in animate.py were missed. Let's make sure that all such things, including these, are fixed in this ticket.See this ask.sagemath.org question for a real-life bug this caused.
Apply attachment: trac_13807_graphics_filename.patch.
Component: misc
Author: John Palmieri
Reviewer: Karl-Dieter Crisman
Merged: sage-5.5.rc1
Issue created by migration from https://trac.sagemath.org/ticket/13807
The text was updated successfully, but these errors were encountered: