summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortomwen <wen66@126.com>2016-12-30 10:21:43 +0800
committertomwen <wen66@126.com>2016-12-30 10:21:43 +0800
commitbb1354b61f10cf82bcd7cccf25de3d3fa2dab4ce (patch)
treeac8abf220d1b30cf79c6c6062685dbc2d3732cae
parentddc4bd30f22e40ae4e3aa9347747f1f96912191a (diff)
downloadtablib-bb1354b61f10cf82bcd7cccf25de3d3fa2dab4ce.tar.gz
remove file must be close it.
in windows if you don't close template file, remove it will raise WindowsError: [Error 32]
-rw-r--r--tablib/formats/_dbf.py1
1 files changed, 1 insertions, 0 deletions
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()