Sfoglia il codice sorgente

dont delete when file has been closed

gaotingquan 1 anno fa
parent
commit
7e2722e61a
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1 1
      paddlex/utils/cache.py

+ 1 - 1
paddlex/utils/cache.py

@@ -114,7 +114,7 @@ class TempFileManager:
         atexit.register(self.cleanup)
 
     def create_temp_file(self, **kwargs):
-        temp_file = tempfile.NamedTemporaryFile(dir=TEMP_DIR, **kwargs)
+        temp_file = tempfile.NamedTemporaryFile(delete=False, dir=TEMP_DIR, **kwargs)
         self.temp_files.append(temp_file)
         return temp_file