| 783 | self.assertEqual(os.path.getmtime(path), tarinfo.mtime) |
| 784 | |
| 785 | def test_extract_pathlike_dir(self): |
| 786 | dirtype = "ustar/dirtype" |
| 787 | DIR = os.path.join(TEMPDIR, "extractall") |
| 788 | with os_helper.temp_dir(DIR), \ |
| 789 | tarfile.open(tarname, encoding="iso8859-1") as tar: |
| 790 | tarinfo = tar.getmember(dirtype) |
| 791 | tar.extract(tarinfo, path=os_helper.FakePath(DIR), filter='fully_trusted') |
| 792 | extracted = os.path.join(DIR, dirtype) |
| 793 | self.assertEqual(os.path.getmtime(extracted), tarinfo.mtime) |
| 794 | |
| 795 | def test_init_close_fobj(self): |
| 796 | # Issue #7341: Close the internal file object in the TarFile |