Skip to content

Commit

Permalink
Merge pull request #1355 from msakai/fix/nc3-endian-bug
Browse files Browse the repository at this point in the history
Fix random "only endian='native' allowed for NETCDF3 files" error
  • Loading branch information
jswhit authored Aug 22, 2024
2 parents f4a97c0 + 0a77731 commit 4c4acc5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/netCDF4/_netCDF4.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2062,10 +2062,11 @@ cdef _get_vars(group, bint auto_complex=False):
endianness = None
with nogil:
ierr = nc_inq_var_endian(_grpid, varid, &iendian)
if ierr == NC_NOERR and iendian == NC_ENDIAN_LITTLE:
endianness = '<'
elif iendian == NC_ENDIAN_BIG:
endianness = '>'
if ierr == NC_NOERR:
if iendian == NC_ENDIAN_LITTLE:
endianness = '<'
elif iendian == NC_ENDIAN_BIG:
endianness = '>'
# check to see if it is a supported user-defined type.
try:
datatype = _nctonptype[xtype]
Expand Down

0 comments on commit 4c4acc5

Please sign in to comment.