Browse code

Use explicit filter for tarfile extraction if available

Hanno Böck authored on 26/05/2023 09:37:08
Showing 1 changed files
... ...
@@ -39,6 +39,9 @@ if new == old:
39 39
 tarball = urllib.request.urlopen(DBURL + str(new) + ".tar.xz").read()
40 40
 
41 41
 tf = tarfile.open(fileobj=io.BytesIO(tarball))
42
-tf.extractall(path=target)
42
+if sys.version_info < (3, 11, 4):
43
+    tf.extractall(path=target)
44
+else:
45
+    tf.extractall(path=target, filter="data")
43 46
 with open(target + "timestamp", "w", encoding="ascii") as f:
44 47
     f.write(str(new))