Input handlers: more closing to help with windows temp files

This commit is contained in:
Jean-Francois Dockes
2019-07-21 10:03:03 +02:00
parent a1daa8de55
commit af664e7768
4 changed files with 42 additions and 6 deletions
+9 -1
View File
@@ -42,6 +42,9 @@ class TarExtractor:
iseof = rclexecm.RclExecM.eofnext
return (ok, docdata, rclexecm.makebytes(ipath), iseof)
def closefile(self):
self.tar = None
def openfile(self, params):
self.currentindex = -1
try:
@@ -71,6 +74,7 @@ class TarExtractor:
self.currentindex = 0
self.em.setmimetype('text/plain')
if len(self.namen) == 0:
self.closefile()
eof = rclexecm.RclExecM.eofnext
else:
eof = rclexecm.RclExecM.noteof
@@ -78,10 +82,14 @@ class TarExtractor:
if self.currentindex >= len(self.namen):
self.namen=[]
self.closefile()
return (False, "", "", rclexecm.RclExecM.eofnow)
else:
ret= self.extractone(self.namen[self.currentindex])
ret = self.extractone(self.namen[self.currentindex])
self.currentindex += 1
if ret[3] == rclexecm.RclExecM.eofnext or \
ret[3] == rclexecm.RclExecM.eofnow:
self.closefile()
return ret