Message263237
| 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:18 | Tomas Tomecek | set | recipients:
+ Tomas Tomecek, vstinner, ezio.melotti |
| 2016年04月12日 08:32:18 | Tomas Tomecek | set | messageid: <1460449938.56.0.948695426963.issue26740@psf.upfronthosting.co.za> |
| 2016年04月12日 08:32:18 | Tomas Tomecek | link | issue26740 messages |
| 2016年04月12日 08:32:17 | Tomas Tomecek | create |
|