Browse Source

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
shadchin 6 months ago
parent
commit
3cfc201582
1 changed files with 4 additions and 1 deletions
  1. 4 1
      build/scripts/extract_docs.py

+ 4 - 1
build/scripts/extract_docs.py

@@ -36,7 +36,10 @@ def main():
         if not os.path.exists(dest_dir):
             os.makedirs(dest_dir)
         with tarfile.open(src, 'r') as tar_file:
-            tar_file.extractall(dest_dir)
+            if sys.version_info >= (3, 12):
+                tar_file.extractall(dest_dir, filter='data')
+            else:
+                tar_file.extractall(dest_dir)
 
 
 if __name__ == '__main__':