Skip to content

Commit

Permalink
FIX: Hack around 3.12rc1 bug (python/cpython#108111)
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Aug 23, 2023
1 parent d6a1b1b commit 02572bb
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nibabel/openers.py
Expand Up @@ -78,6 +78,12 @@ def __init__(
mtime=mtime,
)

def seek(self, pos: int, whence: int = 0, /) -> int:
# Work around bug (gh-180111) in Python 3.12rc1, where seeking without
# flushing can cause write of excess null bytes
self.flush()
return super().seek(pos, whence)


def _gzip_open(
filename: str,
Expand Down

0 comments on commit 02572bb

Please sign in to comment.