Details
Details
- Reviewers
pulkit indygreg - Group Reviewers
hg-reviewers - Commits
- rHGabf252a1c938: archival: tar file modes need to be sysstrs
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit | |
indygreg |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
if kind == 'gz': | if kind == 'gz': | ||||
mode = mode[0:1] | mode = mode[0:1] | ||||
if not fileobj: | if not fileobj: | ||||
fileobj = open(name, mode + 'b') | fileobj = open(name, mode + 'b') | ||||
gzfileobj = self.GzipFileWithTime(name, mode + 'b', | gzfileobj = self.GzipFileWithTime(name, mode + 'b', | ||||
zlib.Z_BEST_COMPRESSION, | zlib.Z_BEST_COMPRESSION, | ||||
fileobj, timestamp=mtime) | fileobj, timestamp=mtime) | ||||
self.fileobj = gzfileobj | self.fileobj = gzfileobj | ||||
return tarfile.TarFile.taropen(name, mode, gzfileobj) | return tarfile.TarFile.taropen( | ||||
name, pycompat.sysstr(mode), gzfileobj) | |||||
else: | else: | ||||
return tarfile.open(name, mode + kind, fileobj) | return tarfile.open( | ||||
name, pycompat.sysstr(mode + kind), fileobj) | |||||
if isinstance(dest, str): | if isinstance(dest, str): | ||||
self.z = taropen('w:', name=dest) | self.z = taropen('w:', name=dest) | ||||
else: | else: | ||||
self.z = taropen('w|', fileobj=dest) | self.z = taropen('w|', fileobj=dest) | ||||
def addfile(self, name, mode, islink, data): | def addfile(self, name, mode, islink, data): | ||||
name = pycompat.fsdecode(name) | name = pycompat.fsdecode(name) |