diff options
Diffstat (limited to 'Lib/tarfile.py')
| -rwxr-xr-x | Lib/tarfile.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 8ed87c2..df4745d 100755 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -2153,10 +2153,10 @@ class TarFile(object): for offset, size in tarinfo.sparse: target.seek(offset) copyfileobj(source, target, size, ReadError) + target.seek(tarinfo.size) + target.truncate() else: copyfileobj(source, target, tarinfo.size, ReadError) - target.seek(tarinfo.size) - target.truncate() def makeunknown(self, tarinfo, targetpath): """Make a file from a TarInfo object with an unknown type |
