8000 bpo-21109: Add SafeTarFile by epicfaace · Pull Request #15244 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

bpo-21109: Add SafeTarFile #15244

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

Closed
wants to merge 15 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add TarFileTest and SafeTarFileTest
  • Loading branch information
epicfaace committed Aug 13, 2019
commit a95ce6ad92d7b404a1c488401a3c140cc851b14a
12 changes: 9 additions & 3 deletions Lib/test/test_tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ def md5sum(data):
md5_regtype = "65f477c818ad9e15f7feab0c6d37742f"
md5_sparse = "a54fbc4ca4f4399a90e1b27164012fc6"

class TarFileTest:
tarfile_module = tarfile.TarFile
tarfile_open = tarfile.open
taropen = tarfile.TarFile.taropen

class SafeTarFileTest:
tarfile_module = tarfile.SafeTarFile
tarfile_open = tarfile.safe_open
taropen = tarfile.SafeTarFile.taropen

class TarTest:
tarname = tarname
Expand Down Expand Up @@ -451,15 +460,12 @@ def members(tar):
self.assertIn(b'ustar/regtype', out)
self.assertNotIn(b'ustar/conttype', out)


class GzipListTest(GzipTest, ListTest):
pass


class Bz2ListTest(Bz2Test, ListTest):
pass


class LzmaListTest(LzmaTest, ListTest):
pass

Expand Down
0