Skip to content

Commit

Permalink
address deprecation warning in tarfile.TarFile.extract all in Python …
Browse files Browse the repository at this point in the history
…>= 3.12: explicitly set filter='data' to prevent writing files via '..' or absolute paths in the source tarfile
  • Loading branch information
nernst committed Feb 16, 2025
1 parent 7ea0a48 commit 5d78971
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nodeenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,10 @@ def download_node_src(node_url, src_dir, args):
for member in members(archive)
if re.match(rexp_string, member_name(member)) is None
]
archive.extractall(src_dir, extract_list)
if sys.version_info >= (3, 12):
archive.extractall(src_dir, extract_list, filter="data")
else:
archive.extractall(src_dir, extract_list)


def urlopen(url):
Expand Down

0 comments on commit 5d78971

Please sign in to comment.