Commits

Lauri Korts-Pärn committed f9c997b Merge

Merged in korc/hachoir/wxgui-dumpdata-fix (pull request #17)

allow dumping huge data objects by using copyfileobj in hachoir-wx

Comments (0)

Files changed (1)

hachoir-wx/hachoir_wx/field_view/stubs.py

 
 from hachoir_core.tools import alignValue
 from hachoir_core.stream.input import FileFromInputStream
+from shutil import copyfileobj
 
 def field_index(field_set, field):
     return field_set._fields.index(field._getName())
 def save_substream_to_disk(field, dest_path):
     dest_stream = open(dest_path, 'wb')
     f = FileFromInputStream(field.getSubIStream())
-    dest_stream.write(f.read())
+    copyfileobj(f, dest_stream)
     dest_stream.close()