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.

Author Tomas Tomecek
Recipients Tomas Tomecek, ezio.melotti, vstinner
Date 2016-04-12.08:32:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1460449938.56.0.948695426963.issue26740@psf.upfronthosting.co.za>
In-reply-to
Content
I have a tarball (generated by docker-1.10 via `docker export`) and am trying to extract it with python 2.7 tarfile:

```
with tarfile.open(name=tarball_path) as tar_fd:
    tar_fd.extractall(path=path)
```

Output from a pytest run:

```
/usr/lib64/python2.7/tarfile.py:2072: in extractall
    for tarinfo in members:
/usr/lib64/python2.7/tarfile.py:2507: in next
    tarinfo = self.tarfile.next()
/usr/lib64/python2.7/tarfile.py:2355: in next
    tarinfo = self.tarinfo.fromtarfile(self)
/usr/lib64/python2.7/tarfile.py:1254: in fromtarfile
    return obj._proc_member(tarfile)
/usr/lib64/python2.7/tarfile.py:1276: in _proc_member
    return self._proc_pax(tarfile)
/usr/lib64/python2.7/tarfile.py:1406: in _proc_pax
    value = value.decode("utf8")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

input = '\x01\x00\x00\x02\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00', errors = 'strict'

    def decode(input, errors='strict'):
>       return codecs.utf_8_decode(input, errors, True)
E       UnicodeDecodeError: 'utf8' codec can't decode byte 0xc0 in position 4: invalid start byte

/usr/lib64/python2.7/encodings/utf_8.py:16: UnicodeDecodeError
```

Since I know nothing about tars, I have no idea if this is a bug or there is a proper solution/workaround.

When using GNU tar, I'm able to to list and extract the tarball.
History
Date User Action Args
2016-04-12 08:32:18Tomas Tomeceksetrecipients: + Tomas Tomecek, vstinner, ezio.melotti
2016-04-12 08:32:18Tomas Tomeceksetmessageid: <1460449938.56.0.948695426963.issue26740@psf.upfronthosting.co.za>
2016-04-12 08:32:18Tomas Tomeceklinkissue26740 messages
2016-04-12 08:32:17Tomas Tomecekcreate