Skip to content

Commit 73b9048

Browse files
committed
owcsvimport: Ensure archive is closed along the ZipFileExt wrapper
1 parent 9303682 commit 73b9048

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Orange/widgets/data/owcsvimport.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,13 @@ def _open(path, mode, encoding=None):
11021102
filelist = arh.infolist()
11031103
if len(filelist) == 1:
11041104
f = arh.open(filelist[0], 'r')
1105+
# patch the f.close to also close the main archive file
1106+
f_close = f.close
1107+
1108+
def close_():
1109+
f_close()
1110+
arh.close()
1111+
f.close = close_
11051112
if 't' in mode:
11061113
f = io.TextIOWrapper(f, encoding=encoding)
11071114
return f

0 commit comments

Comments
 (0)