Merge pull request #328 from coreos-inc/fixtarheders

Fix tarfile to support non-unicode pax fields
This commit is contained in:
josephschorr 2015-08-07 12:05:02 -04:00
commit 4712b27432
5 changed files with 2651 additions and 1 deletions

Binary file not shown.

View file

@ -62,5 +62,12 @@ class TestChanges(unittest.TestCase):
self.assertIn('another_file', deleted_prefixes)
def test_pax_tarfile_error(self):
# If this fails it will raise an exception
with open('test/data/sample/layers/paxheader.tar') as tarstream:
result = list(files_and_dirs_from_tar(tarstream, set()))
self.assertIn('/file', result)
if __name__ == '__main__':
unittest.main()

View file

@ -1,6 +1,8 @@
import marisa_trie
import os
import tarfile
import util.vendor.paxtarfile as tarfile
from util.registry.aufs import is_aufs_metadata, get_deleted_prefix
ALLOWED_TYPES = {tarfile.REGTYPE, tarfile.AREGTYPE}

0
util/vendor/__init__.py vendored Normal file
View file

2641
util/vendor/paxtarfile.py vendored Normal file

File diff suppressed because it is too large Load diff