[Pythonmac-SIG] tarfile fails silently on 10.4?
Nir Soffer
nirs at freeshell.org
Sat Jan 20 15:33:55 CET 2007
I used to use tarfile on 10.3 to extract a bz2 compressed tarball. I
tried the code today on 10.4, and untaring fail silently after about
5% of tarball content, without any error.
This is the failing code:
tar = tarfile.open(os.path.join(SHARE, 'underlay.tar.bz2'),
mode='r:bz2')
for member in tar:
tar.extract(member, WIKI)
tar.close()
The tarball contains 794 pages, but this code will extract only 47
pages. Again, this used to work correctly about 1 year ago with 10.3.7.
The tarball is ok, I can extract the content using tar xjf tarball,
and I even recreated the tarball again with same results.
Same behavior with builtin Python 2.3.5, and Python 2.4.3 from MacPorts.
We used this code instead of using tar command line tool, becaue it
has to run on multiple platforms. After wasting too much time on
stupid differences between bsd tar and gnu tar, we simply moved to
python only solution, which worked great.
Best Regards,
Nir Soffer
More information about the Pythonmac-SIG
mailing list