Merge 3.5, issue #27194
This commit is contained in:
commit
5135e9ed51
|
@ -2153,10 +2153,10 @@ class TarFile(object):
|
||||||
for offset, size in tarinfo.sparse:
|
for offset, size in tarinfo.sparse:
|
||||||
target.seek(offset)
|
target.seek(offset)
|
||||||
copyfileobj(source, target, size, ReadError)
|
copyfileobj(source, target, size, ReadError)
|
||||||
|
target.seek(tarinfo.size)
|
||||||
|
target.truncate()
|
||||||
else:
|
else:
|
||||||
copyfileobj(source, target, tarinfo.size, ReadError)
|
copyfileobj(source, target, tarinfo.size, ReadError)
|
||||||
target.seek(tarinfo.size)
|
|
||||||
target.truncate()
|
|
||||||
|
|
||||||
def makeunknown(self, tarinfo, targetpath):
|
def makeunknown(self, tarinfo, targetpath):
|
||||||
"""Make a file from a TarInfo object with an unknown type
|
"""Make a file from a TarInfo object with an unknown type
|
||||||
|
|
Loading…
Reference in New Issue