Cython: fixed a bug when reading an uncompressed file in binary mode

where the first 4 characters would not be read
This commit is contained in:
Celine Mercier
2018-07-28 17:11:51 +02:00
parent a39f9697be
commit 275d85dc5d

View File

@ -99,6 +99,8 @@ cdef class CompressedFile:
self.accessor = c(magic) self.accessor = c(magic)
if self.accessor is None: if self.accessor is None:
if 'b' in magic.stream_mode:
magic.binary.seek(0)
self.accessor = magic self.accessor = magic
if ((hasattr(stream, 'headers') and if ((hasattr(stream, 'headers') and