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.

Author lars.gustaebel
Recipients lars.gustaebel, r.david.murray, srid
Date 2009-06-05.19:18:28
SpamBayes Score 2.06654e-06
Marked as misclassified No
Message-id <1244229510.0.0.317407817625.issue6196@psf.upfronthosting.co.za>
In-reply-to
Content
Sure, tarfile contains numerous work-arounds for quirky and buggy
archives. Otherwise, it would not be usable in real-life.

But we should not mix up different issues here. tarfile reads and
extracts your generator_tools.tar just fine. Formally, the data is okay.
It's the stored information that is useless and that you are not happy
with. But as we both agree it is rather simple to fix this information
in advance:

import tarfile
tar = tarfile.open("generator_tools-0.3.5.tar.gz")
for t in tar:
    if t.isdir():
        t.mode = 0755
    else:
        t.mode = 0644
tar.extractall()
tar.close()

Sure, there is some functionality in extractall() that addresses issues
with inappropriate permissions, but without this functionality the
archive would not even *extract* cleanly. That is very different from
your problem.

In my opinion, the code above illustrates quite well, that tarfile was
designed to be high-level and flexible at the same time. Make use of
that. I honestly think that extractall() can do well without a
readaccess argument.
History
Date User Action Args
2009-06-05 19:18:30lars.gustaebelsetrecipients: + lars.gustaebel, r.david.murray, srid
2009-06-05 19:18:30lars.gustaebelsetmessageid: <1244229510.0.0.317407817625.issue6196@psf.upfronthosting.co.za>
2009-06-05 19:18:28lars.gustaebellinkissue6196 messages
2009-06-05 19:18:28lars.gustaebelcreate