This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile recognizes .gz file as tar
Type: Stage:
Components: Library (Lib) Versions: Python 3.6, Python 2.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: serhiy.storchaka, spetrunin
Priority: normal Keywords:

Created on 2017-12-27 21:56 by spetrunin, last changed 2022-04-11 14:58 by admin.

Files
File name Uploaded Description Edit
big_0_file_1.gz spetrunin, 2017-12-27 21:56 10 GB of '0' compressed with GZip
Messages (2)
msg309106 - (view) Author: Sergey Petrunin (spetrunin) Date: 2017-12-27 21:56
Library's function 'tarfile.is_tarfile' returns 'True' on GZip file (9.7 megabytes see attachment), that is a file with 10 gigabytes of '0' character compressed with 'gzip' utility (no 'tar' whatsoever).

Desired result: this function should return False in this case, b.c. this file is not a tar file.
msg309108 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-12-27 22:24
This file is a correct empty tar file. The tar utility accepts it too.

$ tar tf big_0_file_1.gz; echo $?
0
History
Date User Action Args
2022-04-11 14:58:56adminsetgithub: 76616
2017-12-27 22:24:14serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg309108
2017-12-27 21:56:20spetrunincreate