Skip to content

bpo-28230: Document the pathlib support in tarfile and add tests. #512

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

serhiy-storchaka
Copy link
Member

No description provided.

@serhiy-storchaka serhiy-storchaka added docs Documentation in the Doc dir type-feature A feature request or enhancement needs backport to 3.6 tests Tests in the Lib/test dir labels Mar 6, 2017
Copy link
Member

@berkerpeksag berkerpeksag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks pretty good to me, thanks! All documented members are correctly tested and tests are passed in my local environment too.

You may want to document this in Misc/NEWS. Side note: We probably should tweak the 3.6 whatsnew document to give readers up-to-date information about pathlib support in the standard library.

I just left a super minor comment.

tarname = pathlib.Path(self.tarname)
with tarfile.open(tarname, mode=self.mode) as tar:
self.assertIsInstance(tar.name, str)
self.assertEqual(tar.name, os.path.abspath(str(tarname)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps use os.fspath instead of str?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@serhiy-storchaka
Copy link
Member Author

I have not added an entry in Misc/NEWS because this change doesn't change the behavior. It just documents existing feature. I'm not sure about What's New document. Path-like support in tarfile (as well as in many other stdlib and third-party modules) is just a side effect of implementing PEP 519 in os and os.path.

@serhiy-storchaka serhiy-storchaka merged commit c45cd16 into python:master Mar 8, 2017
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Mar 8, 2017
@Mariatta
Copy link
Member

Mariatta commented Mar 9, 2017

I removed the needs backport to 3.6 label since it was done.

@serhiy-storchaka serhiy-storchaka deleted the bpo-28230-tarfile-pathlib branch March 30, 2017 18:48
ilevkivskyi pushed a commit to ilevkivskyi/cpython that referenced this pull request Jan 14, 2018
simpkins added a commit to simpkins/typeshed that referenced this pull request May 12, 2022
This method has accepted PathLike objects since Python 3.6
(python/cpython#512)
JelleZijlstra pushed a commit to python/typeshed that referenced this pull request May 12, 2022
This method has accepted PathLike objects since Python 3.6
(python/cpython#512)
jaraco pushed a commit that referenced this pull request Dec 2, 2022
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.16.0 to 0.17.2.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](pytest-dev/pytest-asyncio@v0.16.0...v0.17.2)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Mariatta Wijaya <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir tests Tests in the Lib/test dir type-feature A feature request or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants