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

Yaroslav Halchenko report at bugs.python.org
Mon May 22 23:49:43 EDT 2017


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&dummy script to demonstrate the problem using Python code.  The issue is not just of an academic interest -- git-annex uses read-only permission to safe-guard against manual deletion of content. So tarball of any of git-annex repository carrying content for at least a single file, would not be extractable using Python's tarfile module (works fine with pure tar, verified that it is still failing to extract with Python v3.6.1-228-g1398b1bc7d from http://github.com/python/cpython).

----------
components: IO
files: tarfilero.py
messages: 294217
nosy: Yaroslav.Halchenko
priority: normal
severity: normal
status: open
title: tarfile would fail to extract tarballs with files under R/O directories
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46888/tarfilero.py

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30438>
_______________________________________


More information about the New-bugs-announce mailing list