[Distutils] setuptools.archive_util.unpack_archive dies in case of bad tarball

Łukasz Nowak email at lnowak.com
Thu Nov 18 13:15:32 CET 2010


Hello,

Please see attached tarkill.tar.gz and buildout profile.

This tarball containts dead link:
ls -l tarkill
lrwxrwxrwx 1 luke users 4 2010-11-18 19:56 kill -> kill

After running attached buildout profile and having python shell
setuptools will enter infinite loop:

>>> import sys
>>> sys.version_info
sys.version_info(major=2, minor=7, micro=0, releaselevel='final', serial=0)
>>> import tempfile
>>> import setuptools.archive_util
>>> tempdir = tempfile.mkdtemp()
>>> setuptools.archive_util.unpack_archive('tarkill.tar.gz', tempdir)
^CTraceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/srv/home/luke/python2.7/setup/eggs/setuptools-0.6c12dev_r85381-py2.7.egg/setuptools/archive_util.py",
line 67, in unpack_archive
    driver(filename, extract_dir, progress_filter)
  File "/srv/home/luke/python2.7/setup/eggs/setuptools-0.6c12dev_r85381-py2.7.egg/setuptools/archive_util.py",
line 190, in unpack_tarfile
    member = tarobj._getmember(linkpath)
  File "/srv/home/luke/python2.7/parts/python2.7/lib/python2.7/tarfile.py",
line 2357, in _getmember
    members = self.getmembers()
  File "/srv/home/luke/python2.7/parts/python2.7/lib/python2.7/tarfile.py",
line 1801, in getmembers
    self._check()
KeyboardInterrupt

Attached workaround which breaks the loop, but I think that such
deadlink shall be created, just like tar does it.

Regards,
Luke
-- 
Łukasz Nowak IT Specialist email at lnowak.com http://lnowak.com/
Skype: Shufla jid: shufla at jabster.pl gg: 1157726
``Use the Source, Luke...''
-------------- next part --------------
A non-text attachment was scrubbed...
Name: buildout.cfg
Type: application/octet-stream
Size: 108 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20101118/b4257408/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setuptools-0.6c12dev_r85381.workaround.badtar.patch
Type: text/x-patch
Size: 1099 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20101118/b4257408/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tarkill.tar.gz
Type: application/x-gzip
Size: 146 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20101118/b4257408/attachment-0001.bin>


More information about the Distutils-SIG mailing list