Skip to content

Commit 3bda0f6

Browse files
committed
flush decompressor at end-of-stream
1 parent fa7c213 commit 3bda0f6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

packages/jumpstarter/jumpstarter/streams/encoding.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ async def __anext__(self) -> bytes:
206206
chunk = await self.source.__anext__()
207207
except StopAsyncIteration:
208208
self._exhausted = True
209+
# Flush any remaining data from decompressor (gzip needs this)
210+
if self._decompressor is not None and hasattr(self._decompressor, "flush"):
211+
remaining = self._decompressor.flush()
212+
self._decompressor = None
213+
if remaining:
214+
return remaining
209215
raise
210216

211217
if self._decompressor is not None:

0 commit comments

Comments
 (0)