1The docs tell us that None is returned by extractfile() if the member is a not a regular file or link.
2
3One possible solution is to skip over the None results:
4
5tar = tarfile.open("filename.tar.gz", "r:gz")
6for member in tar.getmembers():
7 f = tar.extractfile(member)
8 if f is not None:
9 content = f.read()