diff options
author | Łukasz Langa <lukasz@langa.pl> | 2016-06-11 16:56:18 -0700 |
---|---|---|
committer | Łukasz Langa <lukasz@langa.pl> | 2016-06-11 16:56:18 -0700 |
commit | 5135e9ed51b6c90d77b4803b3bde5b59035163b0 (patch) | |
tree | 693a8a9094b6e7d783b53506f904803cf6fb2583 /Lib/tarfile.py | |
parent | 6a7506a77f11235b2f1f0e97a2f2eb57e6953d88 (diff) | |
parent | e7f27481a895fb73408e523202345fcd9355b00c (diff) | |
download | cpython-git-5135e9ed51b6c90d77b4803b3bde5b59035163b0.tar.gz |
Merge 3.5, issue #27194
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 8ed87c2f43..df4745d6ba 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 |