Skip to content

Commit

Permalink
Fix deprecation warning from tarfile.extractall()
Browse files Browse the repository at this point in the history
  • Loading branch information
kovidgoyal committed Apr 28, 2024
1 parent 11ad5a1 commit d37f436
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/calibre/utils/hyphenation/dictionaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit d37f436

Please sign in to comment.