From d37f436c4cb26f982c66f1ba8605e49d17d0f50a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 28 Apr 2024 11:41:05 +0530 Subject: [PATCH] Fix deprecation warning from tarfile.extractall() --- src/calibre/utils/hyphenation/dictionaries.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/utils/hyphenation/dictionaries.py b/src/calibre/utils/hyphenation/dictionaries.py index 000f0b7825..92f011ec57 100644 --- a/src/calibre/utils/hyphenation/dictionaries.py +++ b/src/calibre/utils/hyphenation/dictionaries.py @@ -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')