cedadev / cis

Home of the Community Intercomparison Suite.
www.cistools.net
GNU Lesser General Public License v3.0
46 stars 18 forks source link

Minor error message fault #12

Closed adamcpovey closed 5 years ago

adamcpovey commented 6 years ago

It seems pyHDF cleaned up their error messages.

from cis.data_io.hdf import _read_hdf4
_ = _read_hdf4("/not/a/file.hdf", "nothing")

Traceback (most recent call last): File "/home/users/acpovey/bin/miniconda3/lib/python3.5/site-packages/cis/data_io/hdf.py", line 65, in _read_hdf4 sds_dict = hdf_sd.read(filename, variables) File "/home/users/acpovey/bin/miniconda3/lib/python3.5/site-packages/cis/data_io/hdf_sd.py", line 127, in read file (default None, causing all variables to be read). The names must appear exactly as in in the HDF file. File "/home/users/acpovey/bin/miniconda3/lib/python3.5/site-packages/pyhdf/SD.py", line 1439, in init raise HDF4Error("SD: no such file") pyhdf.error.HDF4Error: SD: no such file

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "", line 1, in File "/home/users/acpovey/bin/miniconda3/lib/python3.5/site-packages/cis/data_io/hdf.py", line 79, in _read_hdf4 joined_up_message = "".join(e) TypeError: can only join an iterable

Would you prefer to revert this to raise IOError(str(e)) or something that checks if e is a list?

duncanwp commented 5 years ago

Closed by #13