Skip to content

Commit

Permalink
fix: avoid bug in various patch releases of Python
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii authored and gaborbernat committed Sep 6, 2023
1 parent eada811 commit d6138f5
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/build/_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,15 @@ def parse_wheel_filename(filename: str) -> re.Match[str] | None:

else:
# Per https://peps.python.org/pep-0706/, the "data" filter will become
# the default in Python 3.14.
if sys.version_info < (3, 14) and hasattr(tarfile, 'data_filter'):
# the default in Python 3.14. The first series of releases with the filter
# had a broken filter that could not process symlinks correctly.
if (
(3, 8, 19) <= sys.version_info < (3, 9)
or (3, 9, 19) <= sys.version_info < (3, 10)
or (3, 10, 13) <= sys.version_info < (3, 11)
or (3, 11, 5) < sys.version_info < (3, 12)
or (3, 12) <= sys.version_info < (3, 14)
):

class TarFile(tarfile.TarFile):
extraction_filter = staticmethod(tarfile.data_filter)
Expand Down

0 comments on commit d6138f5

Please sign in to comment.