scipy/scipy — pull request #232 by honnorat (2012-05-28 21:33:13+00:00)
Title: Bug in scipy.io.netcdf

Hi,

There is a bug in scipy.io.netcdf when calling sync() or flush(). When writing to disk, the whole Netcdf structure is written, but the file is not rewound. Therefore, the second call to _write() (which can happen when closing the file) just append a second version of the structure after the first one.

This patch just adds a seek(0) before any writing operation.