bpo-29435: Allow is_tarfile to take a filelike obj#18090
bpo-29435: Allow is_tarfile to take a filelike obj#18090ethanfurman merged 5 commits intopython:masterfrom
Conversation
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept this contribution by verifying everyone involved has signed the PSF contributor agreement (CLA). CLA MissingOur records indicate the following people have not signed the CLA: For legal reasons we need all the people listed to sign the CLA before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. If you have recently signed the CLA, please wait at least one business day You can check yourself to see if the CLA has been received. Thanks again for the contribution, we look forward to reviewing it! |
|
This will need a test similar to one in |
Thanks, will do. |
|
Okay, added tests (for all |
ethanfurman
left a comment
There was a problem hiding this comment.
Looking good.
A couple minor changes to the docs text are needed.
Please add yourself to the Misc/ACKS file.
Doc/library/tarfile.rst
Outdated
|
|
||
| Return :const:`True` if *name* is a tar archive file, that the :mod:`tarfile` | ||
| module can read. | ||
| module can read. *name* may be a file or file-like object too. |
There was a problem hiding this comment.
Change last sentence to:
*name* may be a :class:`str`, file, or file-like object.
Lib/tarfile.py
Outdated
| """Return True if name points to a tar archive that we | ||
| are able to handle, else return False. | ||
|
|
||
| The name argument may be a file or file-like object. |
There was a problem hiding this comment.
Change last sentence to:
'name' should be a string, file, or file-like object.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
I have made the requested changes; please review again! |
|
Thanks for making the requested changes! @ethanfurman: please review the changes made to this pull request. |
`is_tarfile()` now supports `name` being a file or file-like object.
This makes
tarfile.is_tarfilebehave similarly tozipfile.is_zipfile: instead of just a string or path-like, the single positional argument can also be a file or file-like.Ref: https://bugs.python.org/issue29435
https://bugs.python.org/issue29435