You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a reader derives from NetCDF4FileHandler and uses required_netcdf_variables using only root variables, thus no groups and no required variables containing a /, instantiation will fail with UnboundLocalError.
I expect that I can create the file handler, or that it perhaps errors later due to not having implemented some mandatory pseudo-abstract methods.
Actual results
Traceback (most recent call last):
File "/data/gholl/checkouts/protocode/mwe/satpy-req-nc-vars-bug.py", line 16, in <module>
h = NetCDF4FileHandler("/tmp/test.nc", {"stem": "test"}, ft_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/data/gholl/checkouts/satpy/satpy/readers/netcdf_utils.py", line 114, in __init__self._collect_listed_variables(file_handle, listed_variables)
File "/data/gholl/checkouts/satpy/satpy/readers/netcdf_utils.py", line 182, in _collect_listed_variablesif p !="attr":
^UnboundLocalError: cannot access local variable 'p' where it is not associated with a value
Environment Info:
Satpy Version: main (v0.46.0-46-g989d9f0bd)
Additional context
Although I haven't tested it, it would seem to not collect any root variables following an attribute.
I ran into this when writing unit tests for #2686.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a reader derives from
NetCDF4FileHandler
and usesrequired_netcdf_variables
using only root variables, thus no groups and no required variables containing a/
, instantiation will fail withUnboundLocalError
.To Reproduce
Expected behavior
I expect that I can create the file handler, or that it perhaps errors later due to not having implemented some mandatory pseudo-abstract methods.
Actual results
Environment Info:
Additional context
Although I haven't tested it, it would seem to not collect any root variables following an attribute.
I ran into this when writing unit tests for #2686.
The text was updated successfully, but these errors were encountered: