MCPcopy Index your code
hub / github.com/python/cpython / test_length_zero_header

Method test_length_zero_header

Lib/test/test_tarfile.py:519–524  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

517 tar.extractfile(t).read()
518
519 def test_length_zero_header(self):
520 # bpo-39017 (CVE-2019-20907): reading a zero-length header should fail
521 # with an exception
522 with self.assertRaisesRegex(tarfile.ReadError, "file could not be opened successfully"):
523 with tarfile.open(support.findfile('recursion.tar', subdir='archivetestdata')):
524 pass
525
526 def test_extractfile_attrs(self):
527 # gh-74468: TarFile.name must name a file, not a parent archive.

Callers

nothing calls this directly

Calls 2

assertRaisesRegexMethod · 0.80
openMethod · 0.45

Tested by

no test coverage detected