ecmwf / cdsapi

Python API to access the Copernicus Climate Data Store (CDS)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KeyboardInterrupt results in truncated netcdf files

mjroth opened this issue · comments

  • ubuntu 18.04
  • python 3.6.9
  • cdsapi 0.3.0

Retrieving a file, hitting CTRL-C (exception KeyboardInterrupt) during the downloading phase results in a truncated file. This can be problematic as netcdf routines will happily read and return arrays from a truncated file. If the user forces an exit, perhaps the partially downloaded file should be deleted?