[New-bugs-announce] [issue15858] tarfile missing entries due to omitted uid/gid fields

Tom Lynn report at bugs.python.org
Mon Sep 3 21:47:40 CEST 2012

New submission from Tom Lynn:

The tarfile module silently truncates the list of entries when reading a tar file if it sees an entry with a uid/gid field containing only spaces/NULs.  I got such a tarball from Java Maven/plexus-archiver.  I don't know whether they write such fields deliberately, but it seems reasonable to me, especially since they were providing the user/group names textually.

I'd like to see two fixes - a None/-1/0 value for the uid/gid and not silently swallowing HeaderErrors in TarFile.next() (or at least documenting why it's being done).  0 would be consistent with the default value when writing, but None seems more honest.  -1 seems hard to defend.

Only tested on silly Python versions (2.6, PyPy-1.8), sorry.  It's what I've got to hand, but I think this issue also applies to recent Python too going by looking at the hg trunk.

components: Library (Lib)
messages: 169799
nosy: tlynn
priority: normal
severity: normal
status: open
title: tarfile missing entries due to omitted uid/gid fields
type: behavior
versions: 3rd party, Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list