diff --git a/micropython/utarfile/utarfile/__init__.py b/micropython/utarfile/utarfile/__init__.py index 524207aa0..d5a02d9ef 100644 --- a/micropython/utarfile/utarfile/__init__.py +++ b/micropython/utarfile/utarfile/__init__.py @@ -116,7 +116,7 @@ def next(self): # Update the offset once we're sure it's not the run-out. self.offset += len(buf) d = TarInfo(str(h.name, "utf-8").rstrip("\0")) - d.size = int(bytes(h.size), 8) + d.size = int(bytes(h.size.replace(b"\x00", b"")), 8) self.subf = d.subf = FileSection(self.f, d.size, _roundup(d.size, _BLOCKSIZE)) self.offset += _roundup(d.size, _BLOCKSIZE) return d