[New-bugs-announce] [issue23649] tarfile not re-entrant for multi-threading

Srdjan Grubor report at bugs.python.org
Thu Mar 12 17:40:01 CET 2015

New submission from Srdjan Grubor:

When running tarfile.extract through multiple threads, the archive reading pointer is not protected from simultaneous seeks and causes various convoluted bugs:

  <some code>
    self.archive_object.extract(member, extraction_path)
  File "/usr/lib/python3.4/tarfile.py", line 2019, in extract
  File "/usr/lib/python3.4/tarfile.py", line 2088, in _extract_member
    self.makefile(tarinfo, targetpath)
  File "/usr/lib/python3.4/tarfile.py", line 2127, in makefile
  File "/usr/lib/python3.4/gzip.py", line 573, in seek
  File "/usr/lib/python3.4/gzip.py", line 365, in read
    if not self._read(readsize):
  File "/usr/lib/python3.4/gzip.py", line 449, in _read
  File "/usr/lib/python3.4/gzip.py", line 485, in _read_eof
OSError: CRC check failed 0x1036a2e1 != 0x0

messages: 237960
nosy: sgnn7
priority: normal
severity: normal
status: open
title: tarfile not re-entrant for multi-threading
type: behavior
versions: Python 3.4

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list