From 275d85dc5daf99054f40008058c27bfae0e4134f Mon Sep 17 00:00:00 2001 From: Celine Mercier Date: Sat, 28 Jul 2018 17:11:51 +0200 Subject: [PATCH] Cython: fixed a bug when reading an uncompressed file in binary mode where the first 4 characters would not be read --- python/obitools3/files/uncompress.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python/obitools3/files/uncompress.pyx b/python/obitools3/files/uncompress.pyx index 0de9180..59a1fd2 100644 --- a/python/obitools3/files/uncompress.pyx +++ b/python/obitools3/files/uncompress.pyx @@ -99,6 +99,8 @@ cdef class CompressedFile: self.accessor = c(magic) if self.accessor is None: + if 'b' in magic.stream_mode: + magic.binary.seek(0) self.accessor = magic if ((hasattr(stream, 'headers') and