Skip to content

Commit

Permalink
Extract tar files with "data" filter in Python >= 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed Dec 17, 2024
1 parent 88f6be3 commit f647901
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,10 @@ def extract_dep(url: str, filename: str, prefs: dict[str, str]) -> None:
if sources_dir_abs != member_prefix:
msg = "Attempted Path Traversal in Tar File"
raise RuntimeError(msg)
tgz.extractall(sources_dir)
if sys.version_info <= (3, 11):
tgz.extractall(sources_dir)
else:
tgz.extractall(sources_dir, filter="data")
else:
msg = "Unknown archive type: " + filename
raise RuntimeError(msg)
Expand Down

0 comments on commit f647901

Please sign in to comment.