Skip to content

Commit eb39c08

Browse files
committed
FIX: Hack around 3.12rc1 bug (python/cpython#108111)
1 parent 06c1e76 commit eb39c08

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

nibabel/openers.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ def __init__(
7878
mtime=mtime,
7979
)
8080

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

8288
def _gzip_open(
8389
filename: str,

0 commit comments

Comments
 (0)