On Tue, Sep 27, 2022 at 3:58 AM Andrey Novoseltsev <
novo...@gmail.com> wrote:
>
> Hello!
>
> I've run into this while testing upgrades to Ubuntu 22.04 from 20.04, but it seems that it comes from how temporary files are handled in Sage 9.7:
>
> TMP_DIR_FILENAME_BASE=tempfile.TemporaryDirectory()
>
> this temporary directory is created and then used ever after. But what if it gets deleted?
I think it's meant to be used in a context manager, i.e. with with
statement, e.g., citing python docs:
>>> with tempfile.TemporaryDirectory() as tmpdirname:
... print('created temporary directory', tmpdirname)
>>>
# directory and contents have been removed
Or with a callback (from Sage source)
TMP_DIR_FILENAME_BASE=tempfile.TemporaryDirectory()
atexit.register(lambda: TMP_DIR_FILENAME_BASE.cleanup())
Needless to say, one can interfere with it in a bad way messing around
with ~/.sage/ - but so it the case for any file-based process...
For example, what if someone uses tmpreaper or something similar,
when old files are removed from /tmp? Sage does not notice it, but
things break in a weird way, e.g. plots are not displayed and the
error message is not transparent.
>
> I believe this is exactly what is happening and I would appreciate some attention to this matter ;-)
>
> Thank you!
> Andrey
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
sage-devel+...@googlegroups.com.
> To view this discussion on the web visit
https://groups.google.com/d/msgid/sage-devel/5ee63ec7-26b2-4c32-a5a7-45fb63a11327n%40googlegroups.com.