[New-bugs-announce] [issue30438] tarfile would fail to extract tarballs with files under R/O directories
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).
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>
More information about the New-bugs-announce