Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test suite fails with libarchive >= 3.7.5 #130

Closed
rossburton opened this issue Sep 26, 2024 · 2 comments · Fixed by #131
Closed

Test suite fails with libarchive >= 3.7.5 #130

rossburton opened this issue Sep 26, 2024 · 2 comments · Fixed by #131

Comments

@rossburton
Copy link

With libarchive 3.7.4 the test suite passes, but upgrading past 3.7.5 fails:

def test_check_archiveentry_using_python_testtar():
>       check_entries(join(data_dir, 'testtar.tar'))

tests/test_entry.py:67:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_entry.py:95: in check_entries
    actual = list(get_entries(test_file))
tests/__init__.py:47: in get_entries
    for entry in arch:
libarchive/read.py:27: in __iter__
    r = read_next_header2(archive_p, entry._entry_p)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

retcode = -10, func = <_FuncPtr object at 0xffffa1c58590>
args = (187650195747216, 187650196019632)

    def check_int(retcode, func, args):
        if retcode >= 0:
            return retcode
        elif retcode == ARCHIVE_WARN:
            logger.warning(_error_string(args[0]))
            return retcode
        else:
>           raise archive_error(args[0], retcode)
E           libarchive.exception.ArchiveError: Damaged tar archive (errno=22, retcode=-10, archive_p=187650195747216)

libarchive/ffi.py:98: ArchiveError
FAIL: tests/test_entry.py:test_check_archiveentry_using_python_testtar
@Changaco
Copy link
Owner

The test file that causes this error is designed to be tricky, so my solution (#131) is to simply modify the test to handle the raised exception.

If anyone has a problem with the fact that new versions of libarchive reject files that previous versions accepted, please open an issue upstream.

@rossburton
Copy link
Author

Works for me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants