Issue 18575: Fixing tarfile._mode when using gzip via ":gz"
Issue18575
Created on 2013-07-28 08:35 by edulix, last changed 2022-04-11 14:57 by admin.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| gzip.patch | edulix, 2013-07-28 08:39 | |||
| Messages (3) | |||
|---|---|---|---|
| msg193812 - (view) | Author: Eduardo Robles Elvira (edulix) * | Date: 2013-07-28 08:35 | |
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. |
|||
| msg193813 - (view) | Author: Eduardo Robles Elvira (edulix) * | Date: 2013-07-28 08:39 | |
Fixing gzip.patch, it was using basestring (python2) instead of str |
|||
| msg198162 - (view) | Author: Serhiy Storchaka (serhiy.storchaka) * ![]() |
Date: 2013-09-20 19:24 | |
Perhaps we should rather change GzipFile.mode to be a string? |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:48 | admin | set | github: 62775 |
| 2013-09-20 19:24:34 | serhiy.storchaka | set | messages: + msg198162 |
| 2013-08-03 04:21:56 | jcea | set | nosy:
+ jcea |
| 2013-07-28 18:40:36 | serhiy.storchaka | set | nosy:
+ serhiy.storchaka dependencies: + Multivolume support in tarfile module type: behavior stage: patch review |
| 2013-07-28 15:07:05 | ned.deily | set | nosy:
+ lars.gustaebel |
| 2013-07-28 08:39:07 | edulix | set | files:
+ gzip.patch messages: + msg193813 |
| 2013-07-28 08:38:09 | edulix | set | files: - gzip.patch |
| 2013-07-28 08:35:14 | edulix | create | |
