Skip to content
This repository was archived by the owner on Apr 14, 2024. It is now read-only.

Commit 232cf20

Browse files
committed
Fixed incorrect computation of compressed bytes read in zlib decompression stream.
1 parent f26c869 commit 232cf20

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

gitdb/stream.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,10 @@ def read(self, size=-1):
275275
# We feed possibly overlapping chunks, which is why the unconsumed tail
276276
# has to be taken into consideration, as well as the unused data
277277
# if we hit the end of the stream
278-
self._cbr += len(indata) - len(self._zip.unconsumed_tail)
278+
# NOTE: For some reason, the code worked for a long time with substracting unconsumed_tail
279+
# Now, however, it really asks for unused_data, and I wonder whether unconsumed_tail still has to
280+
# be substracted. On the plus side, the tests work, so it seems to be ok for py 2.7 and 3.4
281+
self._cbr += len(indata) - len(self._zip.unconsumed_tail) - len(self._zip.unused_data)
279282
self._br += len(dcompdat)
280283

281284
if dat:

0 commit comments

Comments
 (0)