Skip to content

Commit 3cfc201

Browse files
committed
Fix DeprecationWarning
Python 3.14 will, by default, filter extracted tar archives and reject files or modify their metadata. Use the filter argument to control this behavior. https://docs.python.org/3/library/tarfile.html#tarfile.TarFile.extractall 79005c43af0996c47603d56b5663378c89fa9f2e
1 parent b874288 commit 3cfc201

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

build/scripts/extract_docs.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ def _valid_docslib(path):
3636
if not os.path.exists(dest_dir):
3737
os.makedirs(dest_dir)
3838
with tarfile.open(src, 'r') as tar_file:
39-
tar_file.extractall(dest_dir)
39+
if sys.version_info >= (3, 12):
40+
tar_file.extractall(dest_dir, filter='data')
41+
else:
42+
tar_file.extractall(dest_dir)
4043

4144

4245
if __name__ == '__main__':

0 commit comments

Comments
 (0)