From bb1354b61f10cf82bcd7cccf25de3d3fa2dab4ce Mon Sep 17 00:00:00 2001 From: tomwen Date: Fri, 30 Dec 2016 10:21:43 +0800 Subject: [PATCH] remove file must be close it. in windows if you don't close template file, remove it will raise WindowsError: [Error 32] --- tablib/formats/_dbf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tablib/formats/_dbf.py b/tablib/formats/_dbf.py index 41c2ef4..a0c183d 100644 --- a/tablib/formats/_dbf.py +++ b/tablib/formats/_dbf.py @@ -55,6 +55,7 @@ def export_set(dataset): else: stream = StringIO(dbf_stream.read()) dbf_stream.close() + os.close(temp_file) os.remove(temp_uri) return stream.getvalue()