dataset.freeze should not close provided fileobj

Test and solution for issue pudo/dataset#147
This commit is contained in:
Paul Morelle
2016-01-18 05:11:24 +01:00
parent dc3c14321a
commit 18bd08c009
3 changed files with 13 additions and 2 deletions
+2 -1
View File
@@ -47,4 +47,5 @@ class CSVSerializer(Serializer):
def close(self):
for writer, fh in self.handles.values():
fh.close()
if fh != self.fileobj:
fh.close()
+2 -1
View File
@@ -55,4 +55,5 @@ class JSONSerializer(Serializer):
self.export.get('callback'),
data)
fh.write(data)
fh.close()
if self.fileobj is None:
fh.close()