This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: tarfile archive paths limited to less than 100 chars
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: frehberg, georg.brandl
Priority: normal Keywords:

Created on 2006-12-06 09:58 by frehberg, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
check-tarfile-module.py frehberg, 2006-12-06 09:58 test-script to reproduce the tarfile-bug
Messages (2)
msg30744 - (view) Author: Frank Rehberger (frehberg) Date: 2006-12-06 09:58
The tarfile-module 0.8 shipped with Python-2.5 fails to handle archive-paths longer than 100 chars, in posix mode and GNU-mode.

AFAICS, the  path-length limit should be 256 for posix-mode and infinite for GNU-mode.

The last tarfile module I know, being able to handle long paths is tarfile-0.7.4.

Attached you will find a test-script. The script prints the tarfile.version you are using to console and runs two tests, one for posix-mode up to path-length 256 and a second test for GNU-mode with pathlengths up to 1024.

###
###Testoutput with Python-2.5
###
> /usr/local/bin/python2.5 check-tarfile-module.py
Python Version: 2.5 (r25:51908, Dec  6 2006, 10:13:25)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-47)]
Executable: /home/frehberg/tmp/bin/python
Tarfile Version:  0.8.0
TarFile pathlength check failed, do not use!!
failed for tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/fooo (length 100, posix=True)
TarFile pathlength check failed, do not use!!
failed for tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/tmp/fooo (length 100, posix=False)

###
###Workarround for Python-2.5
###
(Assuming you are using Linux and Python-2.5 has been installed with prefix /usr/local/)

Download tarfile-0.7.4 from http://www.gustaebel.de/lars/tarfile/ and run:

## remove original tarfile-module shipped with
## python2.5
rm -rf /usr/local/lib/python2.5/tarfile.py*

## install tarfile-0.7.4
tar -xvz -C /tmp/ -f /net/linux/pkg/python/tarfile-0.7.4.tar.gz
cd /tmp/tarfile-0.7.4/
/usr/local/bin/python2.5 setup.py install

###
###Testoutput with patched Python-2.5
###
> /usr/local/bin/python2.5 check-tarfile-module.py
Python Version: 2.5 (r25:51908, Dec  6 2006, 10:13:25)
[GCC 3.2.3 20030502 (Red Hat Linux 3.2.3-47)]
Executable: /usr/local/bin/python
Tarfile Version:  0.7.4
Tarfile module (posix=True) is Ok
Tarfile module (posix=False) is Ok
msg30745 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-12-06 22:22
This was fixed by patch #1610437, thanks for the report.
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44309
2006-12-06 09:58:57frehbergcreate