Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions codalab/worker/tar_subdir_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,7 @@ def _read_from_tar(self, num_bytes=None) -> None:
assert self.output.fileobj is not None
self.output.fileobj.write(chunk)
self.current_desc.pos += len(chunk)
# We're ignoring types here because the TarFile.offset type is missing.
# TODO: Remove "# type: ignore" annotations once this PR is merged: https://github.com/python/typeshed/pull/5210
self.output.offset += len(chunk) # type: ignore
self.output.offset += len(chunk)
else:
# We've finished reading the entire current descendant.
# Write the remainder of the block, if needed, and then reset the descendant so it is empty.
Expand All @@ -132,7 +130,7 @@ def _read_from_tar(self, num_bytes=None) -> None:
assert self.output.fileobj is not None
self.output.fileobj.write(tarfile.NUL * (tarfile.BLOCKSIZE - remainder))
blocks += 1
self.output.offset += blocks * tarfile.BLOCKSIZE # type: ignore
self.output.offset += blocks * tarfile.BLOCKSIZE
self.current_desc = CurrentDescendant(
desc=None, pos=0, finfo=EmptyFileInfo, tinfo=tarfile.TarInfo(),
)
Expand Down