FIXUP: Fix a deprecation warning for filter=

This commit is contained in:
Alex Pyrgiotis 2024-10-09 21:54:58 +03:00
parent c37ff7322d
commit 149ba235d9
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA

View file

@ -77,6 +77,12 @@ def main():
for lang in langs_short:
member = f"tessdata_fast-{tag}/{lang}.traineddata"
logger.info(f"Extracting {member}")
# NOTE: We want `filter="data"` because it ignores ownership info, as
# recorded in the tarfile. This filter will become the default in Python
# 3.14. See:
#
# https://docs.python.org/3/library/tarfile.html#tarfile-extraction-filter
t.extract(member=member, path=share_dir, filter="data")
tessdata_dl_dir = share_dir / f"tessdata_fast-{tag}"
tessdata_dl_dir.rename(tessdata_dir)