Fix tarfile to support non-unicode pax fields
This commit is contained in:
parent
44584ff0d8
commit
74d838697f
5 changed files with 2651 additions and 1 deletions
BIN
test/data/sample/layers/paxheader.tar
Normal file
BIN
test/data/sample/layers/paxheader.tar
Normal file
Binary file not shown.
|
@ -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()
|
|
@ -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
0
util/vendor/__init__.py
vendored
Normal file
2641
util/vendor/paxtarfile.py
vendored
Normal file
2641
util/vendor/paxtarfile.py
vendored
Normal file
File diff suppressed because it is too large
Load diff
Reference in a new issue