Fix deprecation warning from tarfile.extractall()

This commit is contained in:
Kovid Goyal 2024-04-28 11:41:05 +05:30
parent 11ad5a1a6e
commit d37f436c4c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -72,7 +72,10 @@ def extract_dicts(cache_path):
buf.seek(0)
tf = tarfile.TarFile(fileobj=buf)
with tf:
tf.extractall(tdir)
try:
tf.extractall(tdir, filter='data')
except TypeError:
tf.extractall(tdir)
with open(os.path.join(tdir, 'sha1sum'), 'wb') as f:
f.write(expected_hash())
dest = os.path.join(cache_path, 'f')