Skip to content

Check symlink target in tar extraction fallback for Pythons without data_filter #13538

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sethmlarson
Copy link
Contributor

Closes #13537

@notatallshaw
Copy link
Member

@sethmlarson thanks for the PR, do you know why Python 3.9 is failing (at least for MacOS)?

@notatallshaw
Copy link
Member

Here's the relevant issue & PR that added the logic you are removing #288 / #293.

Old pip workarounds are usually in there for a reason, and I don't see much documentation from Python on how extractfile should handle symlinks, so it is a bit concerning to remove this.

That said, given it's calling a non-public function it's probably for the best.

@sethmlarson sethmlarson changed the title Let tarfile.extractfile() handle symlinks, even without data_filter [DNM] Let tarfile.extractfile() handle symlinks, even without data_filter Aug 12, 2025
@sethmlarson
Copy link
Contributor Author

@notatallshaw I'll figure out CI, I should have opened this one as a draft but unfortunately there's no going back once it's opened. Will ping again once we get it figured out.

@notatallshaw
Copy link
Member

@sethmlarson don't worry about draft / not draft status, we typically will only merge with an independent maintainer approval and all tests passing.

@sethmlarson sethmlarson changed the title [DNM] Let tarfile.extractfile() handle symlinks, even without data_filter Check symlink target in tar extraction fallback for Pythons without data_filter Aug 13, 2025
@sethmlarson
Copy link
Contributor Author

@notatallshaw Okay, now this PR should be ready for review!

@ichard26
Copy link
Member

@sethmlarson I'm sure if I dug into the unit tests I'd figure it out, but I would appreciate an explanation of why this is necessary or what benefits doing this check brings. I'm not a huge fan of using private functions (especially with how well that worked out with Black).

@notatallshaw
Copy link
Member

As @ichard26 says, I'm a bit confused, this PR started off by removing code, and the news entry still seems to reflect that, but now it just adds an extra private function call.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow tarfile.extractfile() to handle symlinks, even without data_filter support
3 participants