'name is too long' (tarfile, python 2.2, Debian Woody)

Peter Hansen peter at engcorp.com
Wed Aug 20 14:19:55 EDT 2003


Lars Behrens wrote:
> 
> I found this in the tarfile doc:
> 
> -- snip --
> posix=True
> If True, create a POSIX 1003.1-1990 compliant archive. GNU extensions
> are not used, because they are not part of the POSIX standard. This
> limits the length of filenames to at most 256 and linknames to 100
> characters. A ValueError is raised, if a pathname exceeds this limit. If
> False, create a GNU tar compatible archive. It will not be POSIX
> compliant, but can store pathnames of unlimited length.
> -- snap --
> 
> So, I put this in my script:
> 
>   tar.posix=True
> 
> before
> 
>   tar.add('bla')
> 
> This seems to work. But honestly, I don't quite understand
> what I did :-\

Perhaps this is a sign that the problem was really somewhere else.  What
you say you did is not likely to have solved the problem given the
documentation above.  It says that setting tar.posix to *False* would
allow longer path names, not the other way around.  If you think you
just got longer names to work and your problems went away, you
are probably missing something here...

-Peter




More information about the Python-list mailing list