[New-bugs-announce] [issue8464] tarfile creates tarballs with execute permissions set

Lino Mastrodomenico report at bugs.python.org
Mon Apr 19 19:39:00 CEST 2010

New submission from Lino Mastrodomenico <l.mastrodomenico at gmail.com>:

tarfile.open(filename, "w|") creates a tar file with execute permissions set, if filename doesn't exist (i.e. it uses mode 0777 minus the umask). It should instead use mode 0666 minus the umask, which is what happens when using mode "w:..." instead of "w|...".

AFAICT this bug has always been present since the introduction of tarfile in Python 2.3, but it may soon become more noticeable since the new function shutil.make_archive() in Python 2.7 and 3.2 uses tarfile with mode "w|".

I have attached a patch for the trunk.

components: Library (Lib)
files: tarfile.diff
keywords: patch
messages: 103617
nosy: mastrodomenico
severity: normal
status: open
title: tarfile creates tarballs with execute permissions set
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file16991/tarfile.diff

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list