I created a NamedTemporaryFile in my python program with the parameter delete=False because I wanted to keep it for testing. However in the process of testing and running the program over and over it sometimes did not reach the point where the tempfile was closed and/or its path logged so I could delete it manually.
Is there a way to find out where these files are stored? Will they clog up my hard drive or does python choose a directory which is cleaned by my os? The documentation does not talk about this.
tempfile.gettempdir() gives the directory and
tempfile.gettempprefix() gives the prefix of the tempfile names to distinguish them from other files in the directory.
Find undeleted tempfiles in Python