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