Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upbpo-29435: Allow is_tarfile to take a filelike obj #18090
Conversation
This comment has been minimized.
This comment has been minimized.
the-knights-who-say-ni
commented
Jan 20, 2020
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 comment has been minimized.
This comment has been minimized.
This will need a test similar to one in |
This comment has been minimized.
This comment has been minimized.
Thanks, will do. |
This comment has been minimized.
This comment has been minimized.
Okay, added tests (for all |
Looking good. A couple minor changes to the docs text are needed. Please add yourself to the |
@@ -159,7 +159,10 @@ Some facts and figures: | |||
.. function:: is_tarfile(name) | |||
|
|||
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. |
This comment has been minimized.
This comment has been minimized.
ethanfurman
Jan 22, 2020
Member
Change last sentence to:
*name* may be a :class:`str`, file, or file-like object.
@@ -2461,9 +2461,14 @@ def __exit__(self, type, value, traceback): | |||
def is_tarfile(name): | |||
"""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. |
This comment has been minimized.
This comment has been minimized.
ethanfurman
Jan 22, 2020
Member
Change last sentence to:
'name' should be a string, file, or file-like object.
This comment has been minimized.
This comment has been minimized.
bedevere-bot
commented
Jan 22, 2020
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 |
woodruffw commentedJan 20, 2020
•
edited by bedevere-bot
This makes
tarfile.is_tarfile
behave 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