Skip to content

Commit 094aeab

Browse files
committed
fix tar handler: truncated tar files were not processed correctly
Truncated tar files had a performance impact due to an EOFError not being caught and thus the tar file not being recognized, and this got repeated for every file in the truncated tar file. Details: `tarfile.TarFile.next()` does not handle well, when `fileobj.seek` raises an exception: it will not handle it, so the exception will get escalated to the caller, which in turn did not handle it either causing a truncated tar file skipped by the tar handler (in a rather expensive way: throwing away significant work determining the tar chunk's end). The below solution makes sure exceptions escaping tarfile.TarFile.next() are handled. ---- `File.seek` was incorrectly converting `ValueError` to `EOFError`. It is fixed by raising a `File.seek` specific subclass of `ValueError`.
1 parent bf11d02 commit 094aeab

File tree

49 files changed

+175
-15
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+175
-15
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:413d93982446e6ebaf405d4ba8479ebab48f417f57b8de1b86c0961e10eff781
3+
size 10240
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:2a8f79fae21e46b977882ed2665a89f8391caffd7a4844b0b62dd02c5a4b2a02
3+
size 82439
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:482c6c41eda31e50ae678d383bcf84d78920bc532de4414e32423ccbe771f2bf
3+
size 1023
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:d9804c193530de7cec80335025fd3b8928b274c06b67a3861c213045e76e40b0
3+
size 1024
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:7592083f2355ad7e207557efabb3594bf62c9e39677298e8265766a37d835c39
3+
size 8
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:5c486060599c2b3d08d9ba18d8f115b8c582c163630f51b819a546870101bc84
3+
size 1024
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:c4c002915fb9ea3ccf729288165572524435a0e679a29cb6408265cdeeb3aa53
3+
size 8192
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:b4d09282b5ac47cc58aa5dc4fe3e8d6829ac737adfe49ee32efee9cf4bf6cdf3
3+
size 8
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:7843a44cca6d57497113ed505d027b9f5ffac78f1de7809f81ae9b314d943e79
3+
size 8
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:5da5301b576255349a6f72f2f7b71fc76418902b1432a702c6f89b94411f91b9
3+
size 80896

0 commit comments

Comments
 (0)