Skip to content

Reading zero length netCDF or PP files causes cf-python to hang  #422

@ajheaps

Description

@ajheaps

touch dodgy.nc
ipython
import cf
f = cf.read('dodgy.nc')
or
f=cf.read('dodgy.nc', ignore_read_error=True)

The prompt doesn't return and no error is output.

cf.environment(paths=False)
Platform: Linux-5.4.0-121-generic-x86_64-with-glibc2.31
HDF5 library: 1.12.1
netcdf library: 4.8.1
udunits2 library: /home/andy/cfview_distrib/3.9/miniconda3/lib/libudunits2.so.0
Python: 3.9.12
netCDF4: 1.6.0
cftime: 1.6.0
numpy: 1.23.0
psutil: 5.9.1
scipy: 1.8.1
matplotlib: 3.5.2
ESMF: not available
cfdm: 1.9.0.3
cfunits: 3.3.4
cfplot: 3.1.22
cf: 3.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions