| 1211 | tarfile.open(name="foo.tar", fileobj=fobj) |
| 1212 | |
| 1213 | def test_header_offset(self): |
| 1214 | # Test if the start offset of the TarInfo object includes |
| 1215 | # the preceding extended header. |
| 1216 | longname = self.subdir + "/" + "123/" * 125 + "longname" |
| 1217 | offset = self.tar.getmember(longname).offset |
| 1218 | with open(tarname, "rb") as fobj: |
| 1219 | fobj.seek(offset) |
| 1220 | tarinfo = tarfile.TarInfo.frombuf(fobj.read(512), |
| 1221 | "iso8859-1", "strict") |
| 1222 | self.assertEqual(tarinfo.type, self.longnametype) |
| 1223 | |
| 1224 | def test_longname_directory(self): |
| 1225 | # Test reading a longlink directory. Issue #47231. |