tarfile.ReadError: file could not be opened successfully
I have the following piece of code to open a .tgz file, but I'm getting tarfile.ReadError: file could not be opened successfully. fp = tarfile.open('file.tgz', 'r') print fp.list() fp.close() I can extract this archive using "tar -xvzf file.tgz." Apparently it has something to do with the way the file was created because when I compare two different .tgz files using file, I see a difference; file2.tgz works with this piece of code. $ file file.tgz file.tgz: gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT) $ file file2.tgz file2.tgz: gzip compressed data, was "", last modified: Tue
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.