Skip to content

Commit

Permalink
Merge pull request #39 from pauldmccarthy/rf/change_seek_error
Browse files Browse the repository at this point in the history
Rf/change seek error
  • Loading branch information
pauldmccarthy authored Jun 25, 2020
2 parents b13f3da + d685fc3 commit 5797592
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
# `indexed_gzip` changelog


## 1.3.1 (June 25th 2020)


* Reverted the error type raised by the `IndexedGzipFile.seek` to `ValueError`,
as `nibabel` assumes that the `seek` method of file objects raise a
`ValueError` if `SEEK_END` is not supported.


## 1.3.0 (June 24th 2020)


Expand Down
2 changes: 1 addition & 1 deletion indexed_gzip/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
ZranError)


__version__ = '1.3.0'
__version__ = '1.3.1'
4 changes: 2 additions & 2 deletions indexed_gzip/indexed_gzip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,8 @@ cdef class _IndexedGzipFile:
'offset {}'.format(offset))

elif ret == zran.ZRAN_SEEK_INDEX_NOT_BUILT:
raise NotCoveredError('Index must be completely built '
'in order to seek from SEEK_END')
raise ValueError('Index must be completely built '
'in order to seek from SEEK_END')

elif ret not in (zran.ZRAN_SEEK_OK, zran.ZRAN_SEEK_EOF):
raise ZranError('zran_seek returned unknown code: {}'.format(ret))
Expand Down
2 changes: 1 addition & 1 deletion indexed_gzip/tests/ctest_indexed_gzip.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ def test_seek(concat):
results.append((f.read(8), 5))

# SEEK_END only works when index is built
with pytest.raises(igzip.NotCoveredError):
with pytest.raises(ValueError):
f.seek(-100, SEEK_END)

f.build_full_index()
Expand Down

0 comments on commit 5797592

Please sign in to comment.