[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 with that approach.  (Do we 
have a foolproof way to establish that a second addition is a duplicate?  What 
if the filename and path is the same, but the file has been changed since last 
time it was added to the tar?)
 
This solution uses code that's already present.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 than once, *if* the file is not 
writeable.  (tarfile expands the file twice, but the second time finds a 
non-writeable file in the way.)

This was true for Yaroslav's case because his file was added once as its 
directory was added, and again when the file was added directly.  The 
permission of the parent directory does not matter after all.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com