[3.9] gh-102950: Implement PEP 706 – Filter for tarfile.extractall (GH-102953)#104382
[3.9] gh-102950: Implement PEP 706 – Filter for tarfile.extractall (GH-102953)#104382ambv merged 6 commits intopython:3.9from
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