-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tarfile.TarFile.next() crashes on empty tar files #91078
Comments
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 |
progval
mannequin
added
3.9
only security fixes
3.10
only security fixes
stdlib
Python modules in the Lib dir
labels
Mar 4, 2022
iritkatriel
added a commit
to dignissimus/cpython
that referenced
this issue
Nov 26, 2022
ethanfurman
pushed a commit
that referenced
this issue
Nov 26, 2022
…-91850) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this issue
Nov 26, 2022
…ty (pythonGH-91850) (cherry picked from commit 78365b8) Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com> Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
miss-islington
added a commit
that referenced
this issue
Nov 26, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
Linked PRs
The text was updated successfully, but these errors were encountered: