[issue39067] EOFError in tarfile.open

2019-12-17 Thread jvoisin
jvoisin added the comment: Does it means that the right™ way to process untrusted tar files is to wrap every call to functions from tarfile.py in a `try: … except Exception:` block? -- ___ Python tracker ___

[issue39067] EOFError in tarfile.open

2019-12-16 Thread Ronald Oussoren
Ronald Oussoren added the comment: The stdlib documentation does in general not contain exhaustive documentation on exceptions that might be raised. -- assignee: -> docs@python components: +Documentation nosy: +docs@python ___ Python tracker

[issue39067] EOFError in tarfile.open

2019-12-16 Thread jvoisin
jvoisin added the comment: Unfortunately, the documentation ( https://docs.python.org/3/library/tarfile.html) doesn't mention that EOFError is an exception that could be raised when using tarfile.open :/ -- ___ Python tracker

[issue39067] EOFError in tarfile.open

2019-12-16 Thread Ronald Oussoren
Ronald Oussoren added the comment: Looks like expected behaviour, the attached file is an incomplete compressed file that does not seem to contain data (according to gzcat) gzcat: crash-f4032ed3c7c2ae59a8f4424e0e73ce8b11ad3ef90155b008968f5b1b08499bc4: unexpected end of file gzcat: crash-f403

[issue39067] EOFError in tarfile.open

2019-12-16 Thread jvoisin
New submission from jvoisin : The attached file produces the following stacktrace when opened via `tarfile.open`, on Python 3.7.5rc1: ``` $ cat tarrepro.py import tarfile import sys with tarfile.open(sys.argv[1], errorlevel=2) as t: for member in t.getmembers(): pass $ ``` ``` $ pyth