Make a file called targetpath.
(self, tarinfo, targetpath)
| 2449 | raise |
| 2450 | |
| 2451 | def makefile(self, tarinfo, targetpath): |
| 2452 | """Make a file called targetpath. |
| 2453 | """ |
| 2454 | source = self.fileobj |
| 2455 | source.seek(tarinfo.offset_data) |
| 2456 | bufsize = self.copybufsize |
| 2457 | with bltn_open(targetpath, "wb") as target: |
| 2458 | if tarinfo.sparse is not None: |
| 2459 | for offset, size in tarinfo.sparse: |
| 2460 | target.seek(offset) |
| 2461 | copyfileobj(source, target, size, ReadError, bufsize) |
| 2462 | target.seek(tarinfo.size) |
| 2463 | target.truncate() |
| 2464 | else: |
| 2465 | copyfileobj(source, target, tarinfo.size, ReadError, bufsize) |
| 2466 | |
| 2467 | def makeunknown(self, tarinfo, targetpath): |
| 2468 | """Make a file from a TarInfo object with an unknown type |
no test coverage detected