Temporary files not cleaned up on exit #35
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: solderpunk/AV-98#35
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hello, I've noticed AV-98 does not delete all its temporary files upon exit. After some debugging, I believe this happens for temporary files created by
_fetch_over_network
only whencache
option is disabled: https://tildegit.org/solderpunk/AV-98/src/branch/master/av98.py#L523-L531From what I understood, a new temporary files is created on each call of
_fetch_over_network
and the filename is assigned toself.tmp_filename
and, ifcache
option is enabled, is added toself.cache
. Ifcache
option is not enabled,self.tmp_filename
is overwritten each time a new URL is visited, and references to any intermediate temporary files are lost and thus not cleaned up upon exit indo_quit
.Instead of keeping track/manually deleting all the temporary files, perhaps one solution could be to utilize
tempfile.TemporaryDirectory
to store all AV-98 temporary files in one temporary directory that is deleted (including its content) when the object is destroyed/context manager is exited, or manually with.cleanup()
.