Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Support older versions of Python without extraction filters #965

davidmezzetti646af6ba877f
diff --git a/src/python/txtai/archive/tar.py b/src/python/txtai/archive/tar.py
index 81dce221..37c5df4e 100644
--- a/src/python/txtai/archive/tar.py
+++ b/src/python/txtai/archive/tar.py
@@ -34,7 +34,8 @@ class Tar(Compress):
raise IOError(f"Invalid tar entry: {member.name}{'->' + member.linkname if member.linkname else ''}")
# Unpack data. Apply default data filter to only allow basic TAR features.
- tar.extractall(output, filter="data")
+ kwargs = {"filter": "data"} if hasattr(tarfile, "data_filter") else {}
+ tar.extractall(output, **kwargs)
def compression(self, path):
"""