-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
[3.9] gh-102950: Implement PEP 706 – Filter for tarfile.extractall (GH-102953) #104382
Conversation
…et the sticky bit (pythonGH-103831) Also remove expilcit `type=tarfile.DIRTYPE`, the slash at the end is enough. Backport of c8c3956
@encukou if so, 3.8 is also still supported for security fixes. I'd lean +0 because it would:
|
The workaround is quite involved in this case, so one of the suggestions is: if hasattr(tarfile, 'data_filter'):
my_tarfile.extractall(filter='data')
else:
# remove this when no longer needed
warn_the_user('Extracting may be unsafe; consider updating Python')
my_tarfile.extractall() See the PEP's section on backporting: https://peps.python.org/pep-0706/#backporting-forward-compatibility
FWIW, in RHEL we'll probably need to backport regardless of your decision (and probably go with a more aggressive variant, to boot). And yes, if it goes in, 3.8 and 3.7 is next. |
@encukou if you're going to do it for Red Hat anyway, I will happily take it for 3.9 and 3.8. The window for 3.7 support closes in June and I'm sure @ned-deily would accept the filter for the last release of that, too. |
See Backporting & Forward Compatibility in PEP 706.
__all__
entries