Mercurial > hg
comparison mercurial/archival.py @ 4357:3f1b0c0fb4fd
Work around python 2.5.1 tarfile regression
author | Brendan Cully <brendan@kublai.com> |
---|---|
date | Tue, 24 Apr 2007 10:44:13 -0700 |
parents | 1d2fdea875bc |
children | 6af107c742bf |
comparison
equal
deleted
inserted
replaced
4356:aed9e6dceb85 | 4357:3f1b0c0fb4fd |
---|---|
42 '.tgz', '.tbz2']) | 42 '.tgz', '.tbz2']) |
43 self.mtime = mtime | 43 self.mtime = mtime |
44 if isinstance(dest, str): | 44 if isinstance(dest, str): |
45 self.z = tarfile.open(dest, mode='w:'+kind) | 45 self.z = tarfile.open(dest, mode='w:'+kind) |
46 else: | 46 else: |
47 self.z = tarfile.open(mode='w|'+kind, fileobj=dest) | 47 # Python 2.5-2.5.1 have a regression that requires a name arg |
48 self.z = tarfile.open(name='', mode='w|'+kind, fileobj=dest) | |
48 | 49 |
49 def addfile(self, name, mode, data): | 50 def addfile(self, name, mode, data): |
50 i = tarfile.TarInfo(self.prefix + name) | 51 i = tarfile.TarInfo(self.prefix + name) |
51 i.mtime = self.mtime | 52 i.mtime = self.mtime |
52 i.size = len(data) | 53 i.size = len(data) |