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.

classification
Title: tarfile.open: improper handling of path-like object
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: dm, lars.gustaebel, serhiy.storchaka, terry.reedy, xtreak, zygocephalus
Priority: normal Keywords: patch

Created on 2019-06-03 14:54 by dm, last changed 2022-04-11 14:59 by admin.

Files
File name Uploaded Description Edit
poc.py dm, 2019-06-03 14:54 Proof Of Concept
Pull Requests
URL Status Linked Edit
PR 13817 open zygocephalus, 2019-06-04 16:49
Messages (3)
msg344423 - (view) Author: DM (dm) Date: 2019-06-03 14:54
According to the documentation, tarfile.open accepts a path-like object since Python 3.6

However, it is not the case when writing a compressed gzip (w|gz).
See the attached file for minimal POC

Note 1: tested on 3.6 and 3.7
Note 2: https://docs.python.org/3.6/library/tarfile.html#tarfile.open
msg344616 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-06-04 17:44
This was documented in c45cd167d403d7d98078d5fc4a37b16195dc7a35 but it seems a test for opening gzip file with 'w|gz' mode as in the original report was missing.
msg345005 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2019-06-07 19:59
3.6 only gets security patches.  Thanks for testing with 3.7 also.
History
Date User Action Args
2022-04-11 14:59:16adminsetgithub: 81325
2019-06-07 19:59:04terry.reedysetnosy: + terry.reedy

messages: + msg345005
versions: + Python 3.9, - Python 3.6
2019-06-04 17:44:34xtreaksetnosy: + serhiy.storchaka, xtreak, lars.gustaebel

messages: + msg344616
versions: + Python 3.8
2019-06-04 16:49:50zygocephalussetkeywords: + patch
stage: patch review
pull_requests: + pull_request13703
2019-06-04 16:33:09zygocephalussetnosy: + dm
2019-06-04 16:32:39zygocephalussetnosy: + zygocephalus, - dm
2019-06-03 14:54:20dmcreate