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
gh-102950: Implement PEP 706 – Filter for tarfile.extractall #102953
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's what I have so far; still working on tarfile.py
.
When you're done making the requested changes, leave the comment: |
@gpshead, did you want to take a look? |
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the changes in Doc/
.
Doc/library/tarfile.rst
Outdated
|
||
.. versionadded:: 3.12 | ||
|
||
The *tar* format is designed to capture all details of a UNIX-like ecosystem, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *tar* format is designed to capture all details of a UNIX-like ecosystem, | |
The *tar* format is designed to capture all details of a UNIX-like filesystem, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also tend to say POSIX rather than UNIX at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
POSIX is more precise, but this intentionally hand-wavy terminology: I think UNIX-like is more understandable to more people than POSIX-like.
If there are no objections, I plan to merge this around Wednesday. Please let me know if you're working on a review. |
Lib/tarfile.py
Outdated
except TarError as e: | ||
if self.errorlevel > 0: | ||
raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After reading the docs, I thought only OSErrors will be raised with errorlevel == 1. This seems to raise even TarErrors with errorlevel 1 or 2. What do I miss?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh dear. What a rabbit hole. Thanks for raising it, and for a very helpful private discussion.
This warrants an addition to the PEP: https://discuss.python.org/t/23149/26
Please voice your concerns there!
I've updated this PR with my preferred solution, so you can see the areas that need to change and so I get a CI check. It doesn't mean the discussion is over, of course.
|
On WASI, all symlink tests are skipped for now. The mechanism to skip them is a bit of a shortcut that doesn't work here, so on WASI I'll skip the tarfile symlink tests explicitly. |
And aarch64 Debian clang showed an issue in tests: I assumed |
The remaining buildbot failures are unrelated and happened on |
Hi, with this integrated, I see one new test failure on Solaris:
The issue seems to be the fact that setting sticky bit on files as regular user doesn't do anything on Solaris, and from my limited testing, the same seems to be true on some other systems as well (I tried FreeBSD and |
Thanks for the report! The tests are intentionally pretty strict. I'll relax this one. (Edit: see #103831) |
…H-102953) (GH-103832) See [Backporting & Forward Compatibility in PEP 706](https://peps.python.org/pep-0706/#backporting-forward-compatibility). - Backport b52ad18 - Backport c8c3956 - Remove the DeprecationWarning - Adjust docs - Remove new `__all__` entries
GH-104128 is a backport of this pull request to the 3.10 branch. |
GH-104327 is a backport of this pull request to the 3.10 branch. |
…H-102953) (GH-104128) - Backport b52ad18 - Backport c8c3956 - Remove the DeprecationWarning - Adjust docs - Remove new `__all__` entries Co-authored-by: Petr Viktorin <[email protected]>
GH-104382 is a backport of this pull request to the 3.9 branch. |
|
|
A |
GH-104548 is a backport of this pull request to the 3.8 branch. |
GH-104583 is a backport of this pull request to the 3.7 branch. |
See PEP-706 for details.
I might have overengineered the tests a bit, moving boilerplate to a set of helpers. Hopefully the tests themselves are clear enough to make it worth it.