[New-bugs-announce] [issue18575] Fixing tarfile._mode when using gzip via ":gz"

Eduardo Robles Elvira report at bugs.python.org
Sun Jul 28 10:35:14 CEST 2013


New submission from Eduardo Robles Elvira:

A TarFile object constructor accepts a fileobj argument. When this argument is set and it has a "mode" property, tarfile._mode is blindly copied from there. Otherwise, mode is set using the mode argument in the constructor.

This usually works, but in the case where fileobj is a gzip.GzipFile, the "mode" property is not a string like "rb" or "wb" but an integer, which is not expected in TarFile. 

This has not been noticed before probably because the TarFile._mode property is usually unused internally, but in my case it's a problem when using it together with tarfile multivolume mode provided in issue #18321.

----------
components: Library (Lib)
files: gzip.patch
keywords: patch
messages: 193812
nosy: edulix
priority: normal
severity: normal
status: open
title: Fixing tarfile._mode when using gzip via ":gz"
versions: Python 3.4
Added file: http://bugs.python.org/file31061/gzip.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18575>
_______________________________________


More information about the New-bugs-announce mailing list