Message414536
Hi,
I found two related bugs when calling tarfile.TarFile.next() on an empty tar file, both when trying to seek when it should not:
import io
import tarfile
# Create a tarball with no member:
fd = io.BytesIO()
with tarfile.open(fileobj=fd, mode="w") as tf:
pass
# read in stream mode:
fd.seek(0)
with tarfile.open(fileobj=fd, mode="r|") as tf:
print(tf.next()) # tarfile.StreamError: seeking backwards is not allowed
# read in normal mode:
fd.seek(0)
with tarfile.open(fileobj=fd, mode="r") as tf:
print(tf.next()) # ValueError: negative seek value -1 |
|
Date |
User |
Action |
Args |
2022-03-04 16:43:29 | progval | set | recipients:
+ progval |
2022-03-04 16:43:29 | progval | set | messageid: <1646412209.92.0.374671819607.issue46922@roundup.psfhosted.org> |
2022-03-04 16:43:29 | progval | link | issue46922 messages |
2022-03-04 16:43:29 | progval | create | |
|