Merge branch 'python2.6' of github.jpl.nasa.gov:drunge/klaus into python2.6
Dana Runge
7 years ago
1 | 1 | import stat |
2 | 2 | import tarfile |
3 | 3 | from io import BytesIO |
4 | from contextlib import closing | |
4 | 5 | |
5 | 6 | |
6 | 7 | class ListBytesIO(object): |
49 | 50 | time of all files in the resulting .tar.gz archive. |
50 | 51 | """ |
51 | 52 | buf = BytesIO() |
52 | with tarfile.open(None, "w:%s" % format, buf) as tar: | |
53 | with closing(tarfile.open(None, "w:%s" % format, buf)) as tar: | |
53 | 54 | for entry_abspath, entry in walk_tree(repo, tree): |
54 | 55 | try: |
55 | 56 | blob = repo[entry.sha] |