Skip to content

[MAINT] Tests fail on Python 3.11-3.13 with netCDF4 1.7.5 #155

In review

Description

@h-chmeruk

Our tests on develop have been failing for Python 3.11, 3.12, and 3.13 since October 16. netCDF4 1.7.5 was released on October 15, so I suspect the newer netCDF4 version is the cause.
Failing tests:

tests/test_io.py::test_roundtrip[False]
tests/test_io.py::test_roundtrip_multidimensional_string_variable
tests/test_sofa.py::test_add_entry

All fail with AttributeError: 'numpy.ndarray' object has no attribute 'encode', raised by stringtochar(value, encoding='utf-8').

We already exclude netCDF4 1.7.4 in our dependencies (netCDF4!=1.7.4). The easiest workaround would be to set netCDF4<=1.7.3, but I am not sure that is a good idea because it also restricts sofar users. Instead, I would propose to look more closely at the changes in netCDF4 and adapt our code so that it works with newer versions.

I think the error messages and the problem are the same as those already described in the Issue #132.

Activity

  1. added
    bug
    help wanted
    on Dec 2, 2026
  2. moved this from Backlog to Open Discussion in Weekly Planningon Dec 2, 2026
  3. added
    maintenance
    on Dec 2, 2026
  4. h-chmeruk commented on Dec 2, 2026

    @h-chmeruk
    Author

    I link #149 as PR that will close this issue, since all the tests pass there and the mentioned error does not occur anymore.

  5. moved this from Open Discussion to Implementation in progress in Weekly Planningon Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wantedmaintenance

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions