[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-25 Thread Lars Gustäbel
Lars Gustäbel added the comment: Actually, it is not prohibited to add the same file to the same archive more than once. -- nosy: +lars.gustaebel ___ Python tracker

[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-25 Thread Catherine Devlin
Catherine Devlin added the comment: My last commit to the PR includes a fix by delaying setting permission to all files, not just to directories, in .extractall(). It might be better to catch the problem during .add instead, preventing tarring multiple copies, but I found subtle difficulties

[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-24 Thread Catherine Devlin
Catherine Devlin added the comment: Okay, the problem is a little more specific than my last message suggested, but also a little less specific than the original report. A "PermissionError: [Errno 13] Permission denied" is thrown when expanding a tarfile to which a file had been added more

[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-24 Thread Catherine Devlin
Changes by Catherine Devlin : -- pull_requests: +1892 ___ Python tracker ___ ___

[issue30438] tarfile would fail to extract tarballs with files under R/O directories (twice)

2017-05-24 Thread Yaroslav Halchenko
Changes by Yaroslav Halchenko : -- title: tarfile would fail to extract tarballs with files under R/O directories -> tarfile would fail to extract tarballs with files under R/O directories (twice) ___ Python tracker

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-24 Thread Yaroslav Halchenko
Yaroslav Halchenko added the comment: Dear Catherine, Thank you very much for looking into it!! And sorry that I have missed the fact of recursive addition when pointing to a directory. Indeed though, tar handles that case a bit more gracefully. BUT I feel somewhat dumb since I am afraid

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-23 Thread Catherine Devlin
Catherine Devlin added the comment: I apologize, I retract my earlier comment - I believe both Yaroslav and I were confused about the nature of the problem. I think it's not related to permissions at all, but to adding a file to the tarfile twice. To see this, use `tarfilero.py` as provided

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-23 Thread Catherine Devlin
Changes by Catherine Devlin : Removed file: http://bugs.python.org/file46890/issue_30438_test.patch ___ Python tracker ___

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-23 Thread Catherine Devlin
Catherine Devlin added the comment: I confirmed the error, and that doing the corresponding tar/untar cycle with the command-line `tar` utility succeeds. issue_30438_test.patch adds a unittest version of Yaroslav's demo file to test_tarfile.py. (It's irrelevant if the PR is merged.) This

[issue30438] tarfile would fail to extract tarballs with files under R/O directories

2017-05-22 Thread Yaroslav Halchenko
New submission from Yaroslav Halchenko: If tarfile contains a file under a directory which has no write permission, extractall would fail since chmod'ing of the directory is done right when it is "extracted". Please find attached a quick script to demonstrate the problem using Python code.