Skip to content

Commit

Permalink
fix to issue #922
Browse files Browse the repository at this point in the history
  • Loading branch information
jswhit committed May 3, 2019
1 parent 6edf6e2 commit 46eb4d0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
since version 1.5.1.1
==============================
* fix another slicing bug introduced by the fix to issue #906 (issue #922).

version 1.5.1.1 (tag v1.5.1.1rel)
==================================
* fixed __version__ attribute (was set incorrectly in 1.5.1 release).
Expand Down
11 changes: 7 additions & 4 deletions netCDF4/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,10 +409,13 @@ def _StartCountStride(elem, shape, dimensions=None, grp=None, datashape=None,\
if unlim and e.stop is not None and e.stop > shape[i]:
length = e.stop
elif unlim and e.stop is None and datashape != ():
if e.start is None:
length = datashape[i]
else:
length = e.start+datashape[i]
try:
if e.start is None:
length = datashape[i]
else:
length = e.start+datashape[i]
except IndexError:
raise IndexError("Illegal slice")
else:
if unlim and datashape == () and len(dim) == 0:
# writing scalar along unlimited dimension using slicing
Expand Down

0 comments on commit 46eb4d0

Please # to comment.