Author fberger
Recipients eric.araujo, fberger, tarek
Date 2011-07-19.14:13:56
SpamBayes Score 2.76168e-13
Marked as misclassified No
Message-id <1311084837.3.0.496870465183.issue12585@psf.upfronthosting.co.za>
In-reply-to
Content
When creating a source distribution, formats=zip will dereference symbolic links while formats=bztar,gztar will not.

Example:

$ ls -l
drwxr-xr-x 3 4096 19. Jul 15:44 dist
-rw-r--r-- 1   53 19. Jul 15:15 foo.py
-rw-r--r-- 1   42 19. Jul 15:39 MANIFEST
-rw-r--r-- 1   42 19. Jul 15:39 MANIFEST.in
-rw-r--r-- 1  167 19. Jul 15:29 setup.py
-rw-r--r-- 1    5 19. Jul 15:16 test.dat
lrwxrwxrwx 1    8 19. Jul 15:16 test.symlink.dat -> test.dat

$ cat setup.py 
from distutils.core import setup
setup(name = 'foo',
      version = '0.1.0',
      py_modules = ['foo'],
      data_files = [("", ["test.dat", "test.symlink.dat"])])

$ python setup.py sdist --formats=gztar,zip

dist/foo-0.1.0.tar.gz does preserve the symbolic link test.symlink.dat -> test.dat, while dist/foo-0.1.0.zip does not.

This can lead to unexpected behaviour when a symlink points to a file outside the source tree. In the .zip file everything will be fine, while the .tar.* file will contain a broken link.

Actual behaviour: storing of symbolic links depends on the target format.

Expected behaviour: storing of symbolic links should not depend on the target format, i.e. format switches should be transparent. Since the zipfile module apparently does not support symbolic links, symlinks should be dereferenced for formats=gztar,bztar using the dereference=True parameter of tarfile.TarFile() in archive_util.py.
History
Date User Action Args
2011-07-19 14:13:57fbergersetrecipients: + fberger, tarek, eric.araujo
2011-07-19 14:13:57fbergersetmessageid: <1311084837.3.0.496870465183.issue12585@psf.upfronthosting.co.za>
2011-07-19 14:13:56fbergerlinkissue12585 messages
2011-07-19 14:13:56fbergercreate