dataset.freeze should not close provided fileobj
Test and solution for issue pudo/dataset#147
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -55,4 +55,5 @@ class JSONSerializer(Serializer):
|
||||
self.export.get('callback'),
|
||||
data)
|
||||
fh.write(data)
|
||||
fh.close()
|
||||
if self.fileobj is None:
|
||||
fh.close()
|
||||
|
||||
Reference in New Issue
Block a user